|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.sapia.taskman.DefaultTaskOutput
A TaskOutput that logs to System.out. This class
adds "debug level" functionality.
| Field Summary | |
protected String |
_taskName
|
static int |
DEBUG
Identifies the "debug" level - the debug() method
has been called to log a message. |
static int |
ERROR
Identifies the "error" level - the error() method
has been called to log a message. |
static int |
INFO
Identifies the "info" level - the info() method
has been called to log a message. |
static String[] |
LEVEL
An array string constant that holds the name of the logging priority defined by the constants in this class; in fact, each constant corresponds to an index in this array. |
static int |
WARNING
Identifies the "warning" level - the warning() method
has been called to log a message. |
| Constructor Summary | |
DefaultTaskOutput(String taskName,
int level)
Constructor for DefaultTaskLog. |
|
| Method Summary | |
void |
close()
This method has an empty implementation (closing System.out would not be a good idea). |
TaskOutput |
debug(Object message)
Outputs a message of "debug" priority. |
protected void |
doOutput(int lvl,
Object message,
Throwable t)
Template method that can be overriden to log to another place than System.out. |
protected void |
doOutput(Throwable t)
Template method that can be overriden to log to another place than System.out. |
TaskOutput |
error(Object message)
Outputs a message of "error" priority. |
TaskOutput |
error(Object message,
Throwable t)
Outputs a message of "error" priority. |
TaskOutput |
error(Throwable t)
Outputs a message of "error" priority. |
protected String |
getLevelNameFor(int priority)
Returns the name of the passed in priority. |
protected String |
getTaskName()
Returns this instance's name. |
TaskOutput |
info(Object message)
Outputs a message of "info" priority. |
void |
setTaskName(String name)
Sets the name of the task to which this instance corresponds, allowing implementations to display which task is currently generating output. |
TaskOutput |
warning(Object message)
Outputs a message of "warning" priority. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static int DEBUG
debug() method
has been called to log a message.
public static int INFO
info() method
has been called to log a message.
public static int WARNING
warning() method
has been called to log a message.
public static int ERROR
error() method
has been called to log a message.
public static final String[] LEVEL
protected String _taskName
| Constructor Detail |
public DefaultTaskOutput(String taskName,
int level)
| Method Detail |
public void setTaskName(String name)
TaskOutput
setTaskName in interface TaskOutputname - a task name.TaskOutput.setTaskName(String)public TaskOutput debug(Object message)
TaskOutput
debug in interface TaskOutputmessage - a message, as an Object.TaskOutput.debug(Object)
public TaskOutput error(Object message,
Throwable t)
TaskOutput
error in interface TaskOutputmessage - a message, as an Object.t - a Throwable.TaskOutput.error(Object, Throwable)public TaskOutput error(Object message)
TaskOutput
error in interface TaskOutputmessage - a message, as an Object.TaskOutput.error(Object)public TaskOutput error(Throwable t)
TaskOutput
error in interface TaskOutputt - a Throwable.TaskOutput.error(Throwable)public TaskOutput info(Object message)
TaskOutput
info in interface TaskOutputmessage - a message, as an Object.TaskOutput.info(Object)public TaskOutput warning(Object message)
TaskOutput
warning in interface TaskOutputmessage - a message, as an Object.TaskOutput.warning(Object)public void close()
close in interface TaskOutputTaskOutput.close()protected String getTaskName()
protected String getLevelNameFor(int priority)
protected void doOutput(int lvl,
Object message,
Throwable t)
lvl - the priority at which the given message is logged; this
parameter's value corresponds to one of the constants of this class.message - the message that was logged.t - the Throwable that was logged, or null
if no Throwable was logged.DEBUG,
INFO,
WARNING,
ERRORprotected void doOutput(Throwable t)
t - the Throwable that was logged.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||