org.curjent.example.agent.logger
Class LoggerTask

java.lang.Object
  extended by org.curjent.example.agent.logger.LoggerTask
All Implemented Interfaces:
Logger

 class LoggerTask
extends Object
implements Logger

Logger task. The LoggerTask overrides the default unhandled exception handler. The default handler defined in the Factories calls the Logger agent. We configure the Logger agent to print the stack trace of unhandled exceptions directly to the console to avoid an infinite loop. The NullPointerExceptions thrown by the task's log methods are handled in this way.


Field Summary
 
Fields inherited from interface org.curjent.example.agent.logger.Logger
INSTANCE
 
Constructor Summary
LoggerTask()
           
 
Method Summary
 void log(Object object)
           
 void log(String message, Object... args)
           
 void log(String message, Throwable exception)
           
(package private) static Logger newAgent()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggerTask

LoggerTask()
Method Detail

newAgent

static Logger newAgent()

log

public void log(Object object)
Specified by:
log in interface Logger

log

public void log(String message,
                Object... args)
Specified by:
log in interface Logger

log

public void log(String message,
                Throwable exception)
Specified by:
log in interface Logger


Copyright 2009-2011 Tom Landon
Apache License 2.0