Package org.pathvisio.libgpml.debug
Class Logger
java.lang.Object
org.pathvisio.libgpml.debug.Logger
public class Logger
extends java.lang.Object
Logs output to a stream, with the option to filter for types of messages
log levels:
- 1: debug
- 2: trace
- 3: info
- 4: warn
- 5: error
- 6: fatal
- Author:
- unknown
-
Field Summary
Fields Modifier and Type Field Description private boolean
debugEnabled
private boolean
errorEnabled
private boolean
fatalEnabled
private static java.lang.String
FORMAT_STRING
private boolean
infoEnabled
static Logger
log
Global application logger(package private) StopWatch
logTimer
private java.io.PrintStream
s
private boolean
traceEnabled
private boolean
warnEnabled
-
Constructor Summary
Constructors Constructor Description Logger()
-
Method Summary
Modifier and Type Method Description void
debug(java.lang.String msg)
void
error(java.lang.String msg)
void
error(java.lang.String msg, java.lang.Throwable e)
void
fatal(java.lang.String msg)
java.io.PrintStream
getStream()
void
info(java.lang.String msg)
void
setDest(java.lang.String dest)
If dest is "STDERR" or "STDOUT", the standard error / output are used.void
setLogLevel(boolean debug, boolean trace, boolean info, boolean warn, boolean error, boolean fatal)
get/set log level to a certain level.void
setStream(java.io.PrintStream aStream)
void
trace(java.lang.String msg)
void
warn(java.lang.String msg)
void
warn(java.lang.String msg, java.lang.Throwable e)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
debugEnabled
private boolean debugEnabled -
traceEnabled
private boolean traceEnabled -
infoEnabled
private boolean infoEnabled -
warnEnabled
private boolean warnEnabled -
errorEnabled
private boolean errorEnabled -
fatalEnabled
private boolean fatalEnabled -
s
private java.io.PrintStream s -
logTimer
StopWatch logTimer -
FORMAT_STRING
private static final java.lang.String FORMAT_STRING- See Also:
- Constant Field Values
-
log
Global application logger
-
-
Constructor Details
-
Logger
public Logger()
-
-
Method Details
-
getStream
public java.io.PrintStream getStream() -
setStream
public void setStream(java.io.PrintStream aStream) -
setDest
public void setDest(java.lang.String dest)If dest is "STDERR" or "STDOUT", the standard error / output are used. Otherwise, dest is interpreted as a filename.- Parameters:
dest
- the destination for log file.
-
setLogLevel
public void setLogLevel(boolean debug, boolean trace, boolean info, boolean warn, boolean error, boolean fatal)get/set log level to a certain level. The higher the level, the move output. Messages above this level are discarded.- Parameters:
debug
-trace
-info
-warn
-error
-fatal
-
-
trace
public void trace(java.lang.String msg) -
debug
public void debug(java.lang.String msg) -
info
public void info(java.lang.String msg) -
warn
public void warn(java.lang.String msg) -
warn
public void warn(java.lang.String msg, java.lang.Throwable e) -
error
public void error(java.lang.String msg) -
error
public void error(java.lang.String msg, java.lang.Throwable e) -
fatal
public void fatal(java.lang.String msg)
-