Package com.bw.jtools
Class Log.LoggerFacade
- java.lang.Object
-
- com.bw.jtools.Log.LoggerFacade
-
- Direct Known Subclasses:
CollectorLogger,ConsoleLogger,Log4JLogger,MulticastLogger
- Enclosing class:
- Log
public abstract static class Log.LoggerFacade extends java.lang.ObjectAdapter for logging back-ends.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringDEBUG_PREFIXprotected static java.lang.StringERROR_PREFIXprotected static java.lang.StringINFO_PREFIXprotected intlevelprotected intmaxStackTraceLinesprotected static java.lang.StringUNKNW_PREFIXprotected static java.lang.StringWARN_PREFIX
-
Constructor Summary
Constructors Constructor Description LoggerFacade()
-
Method Summary
Modifier and Type Method Description abstract voiddebug(java.lang.CharSequence msg)Logs a debugging message.voiddebug(java.lang.CharSequence msg, java.lang.Throwable t)Logs a warning message error plus message and stack-trace of the Throwable.abstract voiderror(java.lang.CharSequence msg)Logs an error message.voiderror(java.lang.CharSequence msg, java.lang.Throwable t)Logs an error message plus message and stack-trace of the Throwable.intgetLevel()gets the logging level.static java.lang.StringgetLevelPrefix(int level)abstract voidinfo(java.lang.CharSequence msg)Logs an informational message.voidinfo(java.lang.CharSequence msg, java.lang.Throwable t)Logs an informational message error plus message and stack-trace of the Throwable.booleanisDebugEnabled()Checks if debug log-output is enabled.booleanisErrorEnabled()Checks if error log-output is enabled.booleanisInfoEnabled()Checks if informational log-output is enabled.booleanisWarnEnabled()Checks if warning log-output is enabled.voidsetLevel(int level)Sets the logging level.voidsetMaximumLinesOfStackTrace(int maxLines)Sets the maximum length of stack-trace.
0 deactivate any stack-traces.abstract voidwarn(java.lang.CharSequence msg)Logs a warning message.voidwarn(java.lang.CharSequence msg, java.lang.Throwable t)Logs a warning message error plus message and stack-trace of the Throwable.
-
-
-
Field Detail
-
maxStackTraceLines
protected int maxStackTraceLines
-
level
protected int level
-
DEBUG_PREFIX
protected static final java.lang.String DEBUG_PREFIX
- See Also:
- Constant Field Values
-
INFO_PREFIX
protected static final java.lang.String INFO_PREFIX
- See Also:
- Constant Field Values
-
WARN_PREFIX
protected static final java.lang.String WARN_PREFIX
- See Also:
- Constant Field Values
-
ERROR_PREFIX
protected static final java.lang.String ERROR_PREFIX
- See Also:
- Constant Field Values
-
UNKNW_PREFIX
protected static final java.lang.String UNKNW_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLevelPrefix
public static java.lang.String getLevelPrefix(int level)
-
setLevel
public void setLevel(int level)
Sets the logging level.- Parameters:
level- The level.
-
getLevel
public int getLevel()
gets the logging level.- Returns:
- The level.
-
setMaximumLinesOfStackTrace
public void setMaximumLinesOfStackTrace(int maxLines)
Sets the maximum length of stack-trace.
0 deactivate any stack-traces.- Parameters:
maxLines- The maximum number of lines.
-
error
public abstract void error(java.lang.CharSequence msg)
Logs an error message.- Parameters:
msg- The text to log.
-
warn
public abstract void warn(java.lang.CharSequence msg)
Logs a warning message.- Parameters:
msg- The text to log.
-
info
public abstract void info(java.lang.CharSequence msg)
Logs an informational message.- Parameters:
msg- The text to log.
-
debug
public abstract void debug(java.lang.CharSequence msg)
Logs a debugging message.- Parameters:
msg- The text to log.
-
error
public void error(java.lang.CharSequence msg, java.lang.Throwable t)Logs an error message plus message and stack-trace of the Throwable.- Parameters:
msg- The text to log.t- The Throwable to trace.
-
warn
public void warn(java.lang.CharSequence msg, java.lang.Throwable t)Logs a warning message error plus message and stack-trace of the Throwable.- Parameters:
msg- The text to log.t- The Throwable to trace.
-
info
public void info(java.lang.CharSequence msg, java.lang.Throwable t)Logs an informational message error plus message and stack-trace of the Throwable.- Parameters:
msg- The text to log.t- The Throwable to trace.
-
debug
public void debug(java.lang.CharSequence msg, java.lang.Throwable t)Logs a warning message error plus message and stack-trace of the Throwable.- Parameters:
msg- The text to log.t- The Throwable to trace.
-
isDebugEnabled
public boolean isDebugEnabled()
Checks if debug log-output is enabled.- Returns:
- true if current log-level is equal to or higher than DEBUG.
-
isInfoEnabled
public boolean isInfoEnabled()
Checks if informational log-output is enabled.- Returns:
- true if current log-level is equal to or higher than INFO.
-
isWarnEnabled
public boolean isWarnEnabled()
Checks if warning log-output is enabled.- Returns:
- true if current log-level is equal to or higher than WARN.
-
isErrorEnabled
public boolean isErrorEnabled()
Checks if error log-output is enabled.- Returns:
- true if current log-level is equal to or higher than WARN.
-
-