rendsite.tools
Class RendsiteLogger

java.lang.Object
  extended by rendsite.tools.RendsiteLogger
All Implemented Interfaces:
things.common.Debuggable, things.common.StringPoster, things.thinger.io.conduits.PushDrain, things.thinger.io.Logger
Direct Known Subclasses:
RendsiteLogger_Normal

public abstract class RendsiteLogger
extends java.lang.Object
implements things.thinger.io.Logger, things.thinger.io.conduits.PushDrain

Implement a logger. Version History

 10NOV09 - EPG - First package release.
 


Nested Class Summary
 
Nested classes/interfaces inherited from interface things.thinger.io.Logger
things.thinger.io.Logger.LEVEL, things.thinger.io.Logger.TYPE
 
Field Summary
protected  things.thinger.io.conduits.ConduitID conduitId
           
protected  things.thinger.io.Logger.LEVEL currentLevel
           
protected  java.lang.String prefixId
           
 
Constructor Summary
RendsiteLogger(things.common.WhoAmI ownerId, things.thinger.io.Logger.LEVEL level)
          Construct a logger.
 
Method Summary
abstract  RendsiteLogger childLogger(things.common.WhoAmI ownerId)
          Create a child logger.
 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<things.data.NVImmutable> attributes)
          Log a complex debug entry with numerics and attributes.
 void debug(java.lang.String msg, int numeric, things.data.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 debuggingOff()
          Turn debugging off.
 void debuggingOn()
          Turn debugging on.
 boolean debuggingState()
          Get the current debugging state.
 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<things.data.NVImmutable> attributes)
          Log a complex error entry with numerics and attributes.
 void error(java.lang.String msg, int numeric, things.data.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.
 things.thinger.io.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<things.data.NVImmutable> attributes)
          Log a complex information entry with numerics and attributes.
 void info(java.lang.String msg, int numeric, things.data.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(things.thinger.io.conduits.ConduitID yourId)
          Initialize the PushDrain.
 void init(things.thinger.io.Logger.TYPE loggerType)
          Initialized the logger.
 void post(things.data.Entry e)
          Post an Entry.
abstract  void post(long timestamp, things.thinger.io.Logger.LEVEL level, things.data.Data.Priority priority, int numeric, java.lang.String text, java.util.Collection<things.data.NVImmutable> attributes)
          Post it.
 void post(java.lang.String message)
          Post as a message.
 void postit(java.lang.String message)
          Post as a message.
 things.data.Receipt postListener(things.data.Data n)
          Listen for a post.
 void setLevel(things.thinger.io.Logger.LEVEL newLevel)
          This will set the level of entries that will pass.
 void setPostLevel(things.thinger.io.Logger.LEVEL newLevel)
          This will set the default level of StringPoster posted entries.
 void shout(java.lang.String msg, int numeric, things.thinger.io.Logger.LEVEL theLevel)
          Shout a log entry with numerics.
 void shout(java.lang.String msg, int numeric, things.thinger.io.Logger.LEVEL theLevel, java.util.Collection<things.data.NVImmutable> attributes)
          Shout a log entry with numerics and attributes.
 void shout(java.lang.String msg, int numeric, things.thinger.io.Logger.LEVEL theLevel, things.data.NVImmutable... attributes)
          Shout a log entry with numerics and attributes.
 void shout(java.lang.String msg, int numeric, things.thinger.io.Logger.LEVEL theLevel, java.lang.String... attributes)
          Shout a log entry with numerics and attributes.
 void shout(java.lang.String msg, things.thinger.io.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<things.data.NVImmutable> attributes)
          Log a complex warning entry with numerics and attributes.
 void warning(java.lang.String msg, int numeric, things.data.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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface things.thinger.io.Logger
flush
 

Field Detail

prefixId

protected java.lang.String prefixId

conduitId

protected things.thinger.io.conduits.ConduitID conduitId

currentLevel

protected things.thinger.io.Logger.LEVEL currentLevel
Constructor Detail

RendsiteLogger

public RendsiteLogger(things.common.WhoAmI ownerId,
                      things.thinger.io.Logger.LEVEL level)
               throws things.thinger.SystemException
Construct a logger.

Parameters:
ownerId - the owner id. The tag will be available as a prefix to the specific log posters.
level - the starting log level.
Throws:
things.thinger.SystemException
Method Detail

post

public abstract void post(long timestamp,
                          things.thinger.io.Logger.LEVEL level,
                          things.data.Data.Priority priority,
                          int numeric,
                          java.lang.String text,
                          java.util.Collection<things.data.NVImmutable> attributes)
Post it. It should never give an exception.

Parameters:
timestamp -
level -
priority -
numeric -
text -
attributes - it may be null.

childLogger

public abstract RendsiteLogger childLogger(things.common.WhoAmI ownerId)
                                    throws things.thinger.SystemException
Create a child logger. It will differ in ID only.

Parameters:
ownerId -
Returns:
the child logger
Throws:
things.thinger.SystemException

post

public void post(java.lang.String message)
          throws things.common.ThingsException
Post as a message.

Specified by:
post in interface things.common.StringPoster
Parameters:
message - String to post
Throws:
things.common.ThingsException

postit

public void postit(java.lang.String message)
Post as a message. Best effort. Ignore errors.

Specified by:
postit in interface things.common.StringPoster
Parameters:
message - String to post

setLevel

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

Specified by:
setLevel in interface things.thinger.io.Logger
Parameters:
newLevel - the new level.

getLevel

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

Specified by:
getLevel in interface things.thinger.io.Logger
Returns:
the level.

setPostLevel

public void setPostLevel(things.thinger.io.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.

Specified by:
setPostLevel in interface things.thinger.io.Logger
Parameters:
newLevel - the new default level.
Throws:
things.thinger.SystemException

init

public void init(things.thinger.io.conduits.ConduitID yourId)
          throws things.thinger.SystemException
Initialize the PushDrain. This will be called by it's controller. An subsequent calls may result in a PANIC SystemException. Don't do it!

Specified by:
init in interface things.thinger.io.conduits.PushDrain
Parameters:
yourId - The ConduitID for this PushDrain.
Throws:
things.thinger.SystemException
See Also:
ConduitID

postListener

public things.data.Receipt postListener(things.data.Data n)
                                 throws things.thinger.SystemException
Listen for a post. Consumers should implement this.

Specified by:
postListener in interface things.thinger.io.conduits.PushDrain
Parameters:
n - The data to post.
Returns:
a receipt
Throws:
things.thinger.SystemException

init

public void init(things.thinger.io.Logger.TYPE loggerType)
          throws things.thinger.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.

Specified by:
init in interface things.thinger.io.Logger
Parameters:
loggerType - The type of logger this should be. This is more a request than a demand.
Throws:
things.thinger.SystemException

debuggingOn

public void debuggingOn()
Turn debugging on. Logs with debug level priority will be passed.

Specified by:
debuggingOn in interface things.common.Debuggable

debuggingOff

public void debuggingOff()
Turn debugging off. Logs with debug level priority will not be passed.

Specified by:
debuggingOff in interface things.common.Debuggable

debuggingState

public boolean debuggingState()
Get the current debugging state.

Specified by:
debuggingState in interface things.common.Debuggable
Returns:
debugging state

post

public void post(things.data.Entry e)
          throws things.thinger.SystemException
Post an Entry.

Specified by:
post in interface things.thinger.io.Logger
Parameters:
e - The entry.
Throws:
things.thinger.SystemException
See Also:
Entry

exception

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

Specified by:
exception in interface things.thinger.io.Logger
Parameters:
tr - The Exception.
Throws:
things.thinger.SystemException

error

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

Specified by:
error in interface things.thinger.io.Logger
Parameters:
msg - The text message.
Throws:
things.thinger.SystemException

error

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

Specified by:
error in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
Throws:
things.thinger.SystemException

error

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

Specified by:
error in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
things.thinger.SystemException
See Also:
NVImmutable

error

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

Specified by:
error in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
things.thinger.SystemException
See Also:
NVImmutable

error

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

Specified by:
error in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
attributes - Name/value pairs for attributes. Must be an even number of Strings.
Throws:
things.thinger.SystemException

warning

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

Specified by:
warning in interface things.thinger.io.Logger
Parameters:
msg - The text message.
Throws:
things.thinger.SystemException

warning

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

Specified by:
warning in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
Throws:
things.thinger.SystemException

warning

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

Specified by:
warning in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
things.thinger.SystemException
See Also:
NVImmutable

warning

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

Specified by:
warning in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
things.thinger.SystemException
See Also:
NVImmutable

warning

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

Specified by:
warning in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
attributes - Name/value pairs for attributes. Must be an even number of Strings.
Throws:
things.thinger.SystemException

info

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

Specified by:
info in interface things.thinger.io.Logger
Parameters:
msg - The text message.
Throws:
things.thinger.SystemException

info

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

Specified by:
info in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
Throws:
things.thinger.SystemException

info

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

Specified by:
info in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
things.thinger.SystemException
See Also:
NVImmutable

info

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

Specified by:
info in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
things.thinger.SystemException
See Also:
NVImmutable

info

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

Specified by:
info in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
attributes - Name/value pairs for attributes. Must be an even number of Strings.
Throws:
things.thinger.SystemException

debug

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

Specified by:
debug in interface things.thinger.io.Logger
Parameters:
msg - The text message.
Throws:
things.thinger.SystemException

debug

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

Specified by:
debug in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
Throws:
things.thinger.SystemException

debug

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

Specified by:
debug in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
things.thinger.SystemException
See Also:
NVImmutable

debug

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

Specified by:
debug in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
attributes - Sequence of NVs representing attributes.
Throws:
things.thinger.SystemException
See Also:
NVImmutable

debug

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

Specified by:
debug in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
attributes - Name/value pairs for attributes. Must be an even number of Strings.
Throws:
things.thinger.SystemException

shout

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

Specified by:
shout in interface things.thinger.io.Logger
Parameters:
msg - The text message.
theLevel - The level of the message.

shout

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

Specified by:
shout in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
theLevel - The level of the message.

shout

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

Specified by:
shout in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
theLevel - The level of the message.
attributes - Sequence of NVs representing attributes.
See Also:
NVImmutable

shout

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

Specified by:
shout in interface things.thinger.io.Logger
Parameters:
msg - The text message.
numeric - The numeric.
theLevel - The level of the message.
attributes - Sequence of NVs representing attributes.
See Also:
NVImmutable

shout

public void shout(java.lang.String msg,
                  int numeric,
                  things.thinger.io.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.

Specified by:
shout in interface things.thinger.io.Logger
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


rendsite.