public class LogImpl extends Object implements org.apache.commons.logging.Log
DEBUG - if set debugging is output is enabled. DEBUG_PATTERNS - A list of substring patterns used to match against log information for fine grained control of debug logging. DEBUG_VERBOSE - If set to a positive integer, trace and info are enabled. If set to zero, then info is enabled. LOG_SINKS - List of class names used to instantiate the log sinks.This logger can be configured with the org.mortbay.log.Factory
LogFactory
Modifier and Type | Field and Description |
---|---|
LogSink[] |
_sinks |
static String |
DEBUG |
static String |
ERROR |
static String |
FAIL |
static String |
INFO |
static String |
TRACE |
static String |
WARN |
Constructor and Description |
---|
LogImpl()
Construct the shared instance of Log that decodes the
options setup in the environments properties.
|
Modifier and Type | Method and Description |
---|---|
void |
add(LogSink logSink)
Add a Log Sink.
|
void |
add(String logSinkClass)
Add a Log Sink.
|
void |
debug(Object m) |
void |
debug(Object m,
Throwable ex) |
void |
deleteStoppedLogSinks() |
void |
error(Object arg0) |
void |
error(Object arg0,
Throwable arg1) |
void |
fatal(Object arg0) |
void |
fatal(Object arg0,
Throwable arg1) |
boolean |
getDebug()
Get the debug status.
|
String |
getDebugPatterns()
Get the debug patterns.
|
LogSink[] |
getLogSinks() |
boolean |
getSuppressWarnings()
Get the warnings suppression status.
|
int |
getVerbose()
Get the verbosity level.
|
void |
info(Object arg0) |
void |
info(Object arg0,
Throwable arg1) |
boolean |
isDebugEnabled() |
boolean |
isErrorEnabled() |
boolean |
isFatalEnabled() |
boolean |
isInfoEnabled() |
boolean |
isTraceEnabled() |
boolean |
isWarnEnabled() |
void |
message(String tag,
Object msg)
Log a message.
|
void |
message(String tag,
Object msg,
Frame frame) |
void |
message(String tag,
Object msg,
Frame frame,
long time)
Log a message.
|
void |
message(String tag,
Object msg,
int depth)
Log a message.
|
void |
reset()
No logging.
|
void |
setDebug(boolean debug)
Set if debugging is on or off.
|
void |
setDebugPatterns(String patterns)
Set debug patterns.
|
void |
setSuppressWarnings(boolean warnings)
Set warning suppression.
|
void |
setVerbose(int verbose)
Set verbosity level.
|
void |
trace(Object arg0) |
void |
trace(Object arg0,
Throwable arg1) |
void |
warn(Object arg0) |
void |
warn(Object arg0,
Throwable arg1) |
public static final String DEBUG
public static final String INFO
public static final String TRACE
public static final String FAIL
public static final String WARN
public static final String ERROR
public LogSink[] _sinks
public LogImpl()
public void add(LogSink logSink) throws Exception
logSink
- Exception
public void add(String logSinkClass)
logSinkClass
- The logsink classname or null for the default.public void debug(Object m)
debug
in interface org.apache.commons.logging.Log
public void debug(Object m, Throwable ex)
debug
in interface org.apache.commons.logging.Log
public void deleteStoppedLogSinks()
public void reset()
public void error(Object arg0)
error
in interface org.apache.commons.logging.Log
public void error(Object arg0, Throwable arg1)
error
in interface org.apache.commons.logging.Log
public void fatal(Object arg0)
fatal
in interface org.apache.commons.logging.Log
public void fatal(Object arg0, Throwable arg1)
fatal
in interface org.apache.commons.logging.Log
public boolean getDebug()
public String getDebugPatterns()
public LogSink[] getLogSinks()
public boolean getSuppressWarnings()
public int getVerbose()
public void info(Object arg0)
info
in interface org.apache.commons.logging.Log
public void info(Object arg0, Throwable arg1)
info
in interface org.apache.commons.logging.Log
public boolean isDebugEnabled()
isDebugEnabled
in interface org.apache.commons.logging.Log
public boolean isErrorEnabled()
isErrorEnabled
in interface org.apache.commons.logging.Log
public boolean isFatalEnabled()
isFatalEnabled
in interface org.apache.commons.logging.Log
public boolean isInfoEnabled()
isInfoEnabled
in interface org.apache.commons.logging.Log
public boolean isTraceEnabled()
isTraceEnabled
in interface org.apache.commons.logging.Log
public boolean isWarnEnabled()
isWarnEnabled
in interface org.apache.commons.logging.Log
public void message(String tag, Object msg, Frame frame, long time)
tag
- Tag for type of logmsg
- The messageframe
- The frame that generated the message.time
- The time stamp of the message.public void message(String tag, Object msg)
tag
- Tag for type of logmsg
- The messagepublic void message(String tag, Object msg, int depth)
tag
- Tag for type of logmsg
- The messagepublic void setDebug(boolean debug)
debug
- public void setDebugPatterns(String patterns)
patterns
- comma separated string of patternspublic void setSuppressWarnings(boolean warnings)
warnings
- Warnings suppress if this is true and debug is falsepublic void setVerbose(int verbose)
verbose
- public void trace(Object arg0)
trace
in interface org.apache.commons.logging.Log
public void trace(Object arg0, Throwable arg1)
trace
in interface org.apache.commons.logging.Log
public void warn(Object arg0)
warn
in interface org.apache.commons.logging.Log
Copyright © 2016. All Rights Reserved.