things.thinger.io
Interface Logger

All Superinterfaces:
Debuggable, StringPoster
All Known Implementing Classes:
CommandLogger, KernelBasic_WriterLogger

public interface Logger
extends Debuggable

Logging interface for general logging. The implementations will provide a Debuggable interface for simple stuff.

The interface supports logging/entry management across channels, which is the main reason why I didn't use one the popular libraries.

Version:
1.0

Version History

EPG - Adapted from another project - 8 JAN 06
 
Author:
Erich P. Gatejen

Nested Class Summary
static class Logger.LEVEL
          Level of the logged entry.
static class Logger.TYPE
          Types of loggers.
 
Method Summary
 void debug(java.lang.String msg)
          Log a trivial debug entry.
 void debug(java.lang.String msg, int numeric)
          Log a trivial error entry with a numeric.
 void debug(java.lang.String msg, int numeric, java.util.Collection<NVImmutable> attributes)
          Log a complex debug entry with numerics and attributes.
 void debug(java.lang.String msg, int numeric, NVImmutable... attributes)
          Log a complex debug entry with numerics and attributes.
 void debug(java.lang.String msg, int numeric, java.lang.String... attributes)
          Log a complex debug entry with numerics and attributes.
 void error(java.lang.String msg)
          Log a trivial error entry.
 void error(java.lang.String msg, int numeric)
          Log a trivial error entry with a numeric.
 void error(java.lang.String msg, int numeric, java.util.Collection<NVImmutable> attributes)
          Log a complex error entry with numerics and attributes.
 void error(java.lang.String msg, int numeric, NVImmutable... attributes)
          Log a complex error entry with numerics and attributes.
 void error(java.lang.String msg, int numeric, java.lang.String... attributes)
          Log a complex error entry with numerics and attributes.
 void exception(java.lang.Throwable tr)
          Log an exception.
 void flush()
          Tell the underlying system to flush any entries.
 Logger.LEVEL getLevel()
          This will get the level of entries that will pass.
 void info(java.lang.String msg)
          Log a trivial information entry.
 void info(java.lang.String msg, int numeric)
          Log a trivial information entry with a numeric.
 void info(java.lang.String msg, int numeric, java.util.Collection<NVImmutable> attributes)
          Log a complex information entry with numerics and attributes.
 void info(java.lang.String msg, int numeric, NVImmutable... attributes)
          Log a complex information entry with numerics and attributes.
 void info(java.lang.String msg, int numeric, java.lang.String... attributes)
          Log a complex info entry with numerics and attributes.
 void init(Logger.TYPE loggerType)
          Initialized the logger.
 void post(Entry e)
          Post an Entry.
 void setLevel(Logger.LEVEL newLevel)
          This will set the level of entries that will pass.
 void setPostLevel(Logger.LEVEL newLevel)
          This will set the default level of StringPoster posted entries.
 void shout(java.lang.String msg, int numeric, Logger.LEVEL theLevel)
          Shout a log entry with numerics.
 void shout(java.lang.String msg, int numeric, Logger.LEVEL theLevel, java.util.Collection<NVImmutable> attributes)
          Shout a log entry with numerics and attributes.
 void shout(java.lang.String msg, int numeric, Logger.LEVEL theLevel, NVImmutable... attributes)
          Shout a log entry with numerics and attributes.
 void shout(java.lang.String msg, int numeric, Logger.LEVEL theLevel, java.lang.String... attributes)
          Shout a log entry with numerics and attributes.
 void shout(java.lang.String msg, Logger.LEVEL theLevel)
          Shout a log entry.
 void warning(java.lang.String msg)
          Log a trivial warning entry.
 void warning(java.lang.String msg, int numeric)
          Log a trivial warning entry with a numeric.
 void warning(java.lang.String msg, int numeric, java.util.Collection<NVImmutable> attributes)
          Log a complex warning entry with numerics and attributes.
 void warning(java.lang.String msg, int numeric, NVImmutable... attributes)
          Log a complex warning entry with numerics and attributes.
 void warning(java.lang.String msg, int numeric, java.lang.String... attributes)
          Log a complex warning entry with numerics and attributes.
 
Methods inherited from interface things.common.Debuggable
debuggingOff, debuggingOn, debuggingState
 
Methods inherited from interface things.common.StringPoster
post, postit
 

Method Detail

init

void init(Logger.TYPE loggerType)
          throws SystemException
Initialized the logger. This will be done by the constructing system, typically the System or Kernel, so most users should not call this directly.

Parameters:
loggerType - The type of logger this should be. This is more a request than a demand.
Throws:
SystemException

setLevel

void setLevel(Logger.LEVEL newLevel)
This will set the level of entries that will pass. It starts at whatever the implementation sets during construction.

Parameters:
newLevel - the new level.

getLevel

Logger.LEVEL getLevel()
This will get the level of entries that will pass. It starts at whatever the implementation sets during construction.

Returns:
the level.

setPostLevel

void setPostLevel(Logger.LEVEL newLevel)
This will set the default level of StringPoster posted entries. The default starts as DATA. That means, all posted strings will be treated as DATA level.

Parameters:
newLevel - the new default level.
Throws:
SystemException

flush

void flush()
Tell the underlying system to flush any entries.

Specified by:
flush in interface StringPoster

post

void post(Entry e)
          throws SystemException
Post an Entry.

Parameters:
e - The entry.
Throws:
SystemException
See Also:
Entry

exception

void exception(java.lang.Throwable tr)
               throws SystemException
Log an exception. The implementation should try to deal with the ThingsException features.

Parameters:
tr - The Exception.
Throws:
SystemException

error

void error(java.lang.String msg)
           throws SystemException
Log a trivial error entry.

Parameters:
msg - The text message.
Throws:
SystemException

error

void error(java.lang.String msg,
           int numeric)
           throws SystemException
Log a trivial error entry with a numeric.

Parameters:
msg - The text message.
numeric - The numeric.
Throws:
SystemException

error

void error(java.lang.String msg,
           int numeric,
           NVImmutable... attributes)
           throws SystemException
Log a complex error entry with numerics and attributes.

Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
SystemException
See Also:
NVImmutable

error

void error(java.lang.String msg,
           int numeric,
           java.util.Collection<NVImmutable> attributes)
           throws SystemException
Log a complex error entry with numerics and attributes.

Parameters:
msg - The text message.
numeric - The numeric.
attributes - C of NVs representing attributes.
Throws:
SystemException
See Also:
NVImmutable

error

void error(java.lang.String msg,
           int numeric,
           java.lang.String... attributes)
           throws SystemException
Log a complex error entry with numerics and attributes.

Parameters:
msg - The text message.
numeric - The numeric.
attributes - Name/value pairs for attributes. Must be an even number of Strings.
Throws:
SystemException
See Also:
NV

warning

void warning(java.lang.String msg)
             throws SystemException
Log a trivial warning entry.

Parameters:
msg - The text message.
Throws:
SystemException

warning

void warning(java.lang.String msg,
             int numeric)
             throws SystemException
Log a trivial warning entry with a numeric.

Parameters:
msg - The text message.
numeric - The numeric.
Throws:
SystemException

warning

void warning(java.lang.String msg,
             int numeric,
             java.lang.String... attributes)
             throws SystemException
Log a complex warning entry with numerics and attributes.

Parameters:
msg - The text message.
numeric - The numeric.
attributes - Name/value pairs for attributes. Must be an even number of Strings.
Throws:
SystemException

warning

void warning(java.lang.String msg,
             int numeric,
             NVImmutable... attributes)
             throws SystemException
Log a complex warning entry with numerics and attributes.

Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
SystemException
See Also:
NVImmutable

warning

void warning(java.lang.String msg,
             int numeric,
             java.util.Collection<NVImmutable> attributes)
             throws SystemException
Log a complex warning entry with numerics and attributes.

Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
SystemException
See Also:
NVImmutable

info

void info(java.lang.String msg)
          throws SystemException
Log a trivial information entry.

Parameters:
msg - The text message.
Throws:
SystemException

info

void info(java.lang.String msg,
          int numeric)
          throws SystemException
Log a trivial information entry with a numeric.

Parameters:
msg - The text message.
numeric - The numeric.
Throws:
SystemException

info

void info(java.lang.String msg,
          int numeric,
          java.lang.String... attributes)
          throws SystemException
Log a complex info entry with numerics and attributes.

Parameters:
msg - The text message.
numeric - The numeric.
attributes - Name/value pairs for attributes. Must be an even number of Strings.
Throws:
SystemException

info

void info(java.lang.String msg,
          int numeric,
          NVImmutable... attributes)
          throws SystemException
Log a complex information entry with numerics and attributes.

Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
SystemException
See Also:
NVImmutable

info

void info(java.lang.String msg,
          int numeric,
          java.util.Collection<NVImmutable> attributes)
          throws SystemException
Log a complex information entry with numerics and attributes.

Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
SystemException
See Also:
NVImmutable

debug

void debug(java.lang.String msg)
           throws SystemException
Log a trivial debug entry.

Parameters:
msg - The text message.
Throws:
SystemException

debug

void debug(java.lang.String msg,
           int numeric)
           throws SystemException
Log a trivial error entry with a numeric.

Parameters:
msg - The text message.
numeric - The numeric.
Throws:
SystemException

debug

void debug(java.lang.String msg,
           int numeric,
           java.lang.String... attributes)
           throws SystemException
Log a complex debug entry with numerics and attributes.

Parameters:
msg - The text message.
numeric - The numeric.
attributes - Name/value pairs for attributes. Must be an even number of Strings.
Throws:
SystemException
See Also:
NV

debug

void debug(java.lang.String msg,
           int numeric,
           NVImmutable... attributes)
           throws SystemException
Log a complex debug entry with numerics and attributes.

Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
SystemException
See Also:
NVImmutable

debug

void debug(java.lang.String msg,
           int numeric,
           java.util.Collection<NVImmutable> attributes)
           throws SystemException
Log a complex debug entry with numerics and attributes.

Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
SystemException
See Also:
NVImmutable

shout

void shout(java.lang.String msg,
           Logger.LEVEL theLevel)
Shout a log entry. This is best effort and it will never return an exception.

Parameters:
msg - The text message.
theLevel - The level of the message.

shout

void shout(java.lang.String msg,
           int numeric,
           Logger.LEVEL theLevel,
           java.lang.String... attributes)
Shout a log entry with numerics and attributes. This is best effort and it will never return an exception.

Parameters:
msg - The text message.
numeric - The numeric.
theLevel - The level of the message.
attributes - Name/value pairs for attributes. Must be an even number of Strings.
See Also:
NV

shout

void shout(java.lang.String msg,
           int numeric,
           Logger.LEVEL theLevel)
Shout a log entry with numerics. This is best effort and it will never return an exception.

Parameters:
msg - The text message.
numeric - The numeric.
theLevel - The level of the message.
See Also:
NV

shout

void shout(java.lang.String msg,
           int numeric,
           Logger.LEVEL theLevel,
           NVImmutable... attributes)
Shout a log entry with numerics and attributes. This is best effort and it will never return an exception.

Parameters:
msg - The text message.
numeric - The numeric.
theLevel - The level of the message.
attributes - Sequence of NVs representing attributes.
See Also:
NVImmutable

shout

void shout(java.lang.String msg,
           int numeric,
           Logger.LEVEL theLevel,
           java.util.Collection<NVImmutable> attributes)
Shout a log entry with numerics and attributes. This is best effort and it will never return an exception.

Parameters:
msg - The text message.
numeric - The numeric.
theLevel - The level of the message.
attributes - Sequence of NVs representing attributes.
See Also:
NVImmutable


Things.