Package helma.util
Class Logger
java.lang.Object
helma.util.Logger
- All Implemented Interfaces:
org.apache.commons.logging.Log
- Direct Known Subclasses:
FileLogger
A simple logger that writes to a PrintStream such as System.out.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Logger
(PrintStream out) Create a logger for a PrintStream, such as System.out. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
protected void
This is called by the runner thread to to make sure we have an open writer.void
void
void
void
Return an object which identifies this logger.int
Get the current log level.protected org.apache.commons.logging.Log
return a "quiet" version of this log that routes debug() output to trace()static String
void
void
boolean
boolean
boolean
boolean
boolean
boolean
protected void
Append a message to the log.protected static void
void
setLogLevel
(int logLevel) Set the log level for this logger.toString()
Return a string representation of this Loggervoid
void
void
void
protected void
write()
This is called by the runner thread to perform actual output.
-
Field Details
-
TRACE
public static final int TRACE- See Also:
-
DEBUG
public static final int DEBUG- See Also:
-
INFO
public static final int INFO- See Also:
-
WARN
public static final int WARN- See Also:
-
ERROR
public static final int ERROR- See Also:
-
FATAL
public static final int FATAL- See Also:
-
-
Constructor Details
-
Logger
Create a logger for a PrintStream, such as System.out.- Parameters:
out
- the output stream
-
-
Method Details
-
getLogLevel
public int getLogLevel()Get the current log level.- Returns:
- the current log level
-
setLogLevel
public void setLogLevel(int logLevel) Set the log level for this logger.- Parameters:
logLevel
- the new log level
-
toString
Return a string representation of this Logger -
getCanonicalName
Return an object which identifies this logger.- Returns:
- the canonical name of this logger
-
log
Append a message to the log.- Parameters:
level
- a string representing the log levelmsg
- the log messageexception
- an exception, or null
-
write
protected void write()This is called by the runner thread to perform actual output. -
ensureOpen
protected void ensureOpen()This is called by the runner thread to to make sure we have an open writer. -
renderDate
protected static void renderDate() -
isTraceEnabled
public boolean isTraceEnabled()- Specified by:
isTraceEnabled
in interfaceorg.apache.commons.logging.Log
-
isDebugEnabled
public boolean isDebugEnabled()- Specified by:
isDebugEnabled
in interfaceorg.apache.commons.logging.Log
-
isInfoEnabled
public boolean isInfoEnabled()- Specified by:
isInfoEnabled
in interfaceorg.apache.commons.logging.Log
-
isWarnEnabled
public boolean isWarnEnabled()- Specified by:
isWarnEnabled
in interfaceorg.apache.commons.logging.Log
-
isErrorEnabled
public boolean isErrorEnabled()- Specified by:
isErrorEnabled
in interfaceorg.apache.commons.logging.Log
-
isFatalEnabled
public boolean isFatalEnabled()- Specified by:
isFatalEnabled
in interfaceorg.apache.commons.logging.Log
-
trace
- Specified by:
trace
in interfaceorg.apache.commons.logging.Log
-
trace
- Specified by:
trace
in interfaceorg.apache.commons.logging.Log
-
debug
- Specified by:
debug
in interfaceorg.apache.commons.logging.Log
-
debug
- Specified by:
debug
in interfaceorg.apache.commons.logging.Log
-
info
- Specified by:
info
in interfaceorg.apache.commons.logging.Log
-
info
- Specified by:
info
in interfaceorg.apache.commons.logging.Log
-
warn
- Specified by:
warn
in interfaceorg.apache.commons.logging.Log
-
warn
- Specified by:
warn
in interfaceorg.apache.commons.logging.Log
-
error
- Specified by:
error
in interfaceorg.apache.commons.logging.Log
-
error
- Specified by:
error
in interfaceorg.apache.commons.logging.Log
-
fatal
- Specified by:
fatal
in interfaceorg.apache.commons.logging.Log
-
fatal
- Specified by:
fatal
in interfaceorg.apache.commons.logging.Log
-
getStackTrace
-
getSedatedLog
protected org.apache.commons.logging.Log getSedatedLog()return a "quiet" version of this log that routes debug() output to trace()- Returns:
- a possibly less verbose version of this log.
-