org.jfree.util

Class LogContext

public class LogContext extends Object

A log context.

Author: Thomas Morgner

Constructor Summary
LogContext(String contextPrefix)
Creates a new log context.
Method Summary
voiddebug(Object message)
A convenience method for logging a 'debug' message.
voiddebug(Object message, Exception e)
A convenience method for logging a 'debug' message.
booleanequals(Object o)
Tests this object for equality with an arbitrary object.
voiderror(Object message)
A convenience method for logging an 'error' message.
voiderror(Object message, Exception e)
A convenience method for logging an 'error' message.
inthashCode()
Returns a hashcode.
voidinfo(Object message)
A convenience method for logging an 'info' message.
voidinfo(Object message, Exception e)
A convenience method for logging an 'info' message.
booleanisDebugEnabled()
Returns true, if the log level allows debug messages to be printed.
booleanisErrorEnabled()
Returns true, if the log level allows error messages to be printed.
booleanisInfoEnabled()
Returns true, if the log level allows informational messages to be printed.
booleanisWarningEnabled()
Returns true, if the log level allows warning messages to be printed.
voidlog(int level, Object message)
Logs a message to the main log stream.
voidlog(int level, Object message, Exception e)
Logs a message to the main log stream.
voidwarn(Object message)
A convenience method for logging a 'warning' message.
voidwarn(Object message, Exception e)
A convenience method for logging a 'warning' message.

Constructor Detail

LogContext

public LogContext(String contextPrefix)
Creates a new log context.

Parameters: contextPrefix the prefix.

Method Detail

debug

public void debug(Object message)
A convenience method for logging a 'debug' message.

Parameters: message the message.

debug

public void debug(Object message, Exception e)
A convenience method for logging a 'debug' message.

Parameters: message the message. e the exception.

equals

public boolean equals(Object o)
Tests this object for equality with an arbitrary object.

Parameters: o the object to test against (null permitted).

Returns: A boolean.

error

public void error(Object message)
A convenience method for logging an 'error' message.

Parameters: message the message.

error

public void error(Object message, Exception e)
A convenience method for logging an 'error' message.

Parameters: message the message. e the exception.

hashCode

public int hashCode()
Returns a hashcode.

Returns: The hashcode.

info

public void info(Object message)
A convenience method for logging an 'info' message.

Parameters: message the message.

info

public void info(Object message, Exception e)
A convenience method for logging an 'info' message.

Parameters: message the message. e the exception.

isDebugEnabled

public boolean isDebugEnabled()
Returns true, if the log level allows debug messages to be printed.

Returns: true, if messages with an log level of DEBUG are allowed.

isErrorEnabled

public boolean isErrorEnabled()
Returns true, if the log level allows error messages to be printed.

Returns: true, if messages with an log level of ERROR are allowed.

isInfoEnabled

public boolean isInfoEnabled()
Returns true, if the log level allows informational messages to be printed.

Returns: true, if messages with an log level of INFO are allowed.

isWarningEnabled

public boolean isWarningEnabled()
Returns true, if the log level allows warning messages to be printed.

Returns: true, if messages with an log level of WARN are allowed.

log

public void log(int level, Object message)
Logs a message to the main log stream. All attached log targets will also receive this message. If the given log-level is higher than the given debug-level in the main config file, no logging will be done.

Parameters: level log level of the message. message text to be logged.

log

public void log(int level, Object message, Exception e)
Logs a message to the main log stream. All attached logTargets will also receive this message. If the given log-level is higher than the given debug-level in the main config file, no logging will be done.

The exception's stacktrace will be appended to the log-stream

Parameters: level log level of the message. message text to be logged. e the exception, which should be logged.

warn

public void warn(Object message)
A convenience method for logging a 'warning' message.

Parameters: message the message.

warn

public void warn(Object message, Exception e)
A convenience method for logging a 'warning' message.

Parameters: message the message. e the exception.