Class SimpleLog
- All Implemented Interfaces:
org.apache.commons.logging.Log
Simple implementation of Log that sends all enabled log messages, for all defined loggers, to System.err.
Hacked from commons-logging SimpleLog for use in discovery. This is intended to be enough of a Log implementation to bootstrap Discovery.
One property: org.apache.commons.discovery.log.level.
valid values: all, trace, debug, info, warn, error, fatal, off.
- Version:
- $Id: SimpleLog.java 1089489 2011-04-06 15:20:24Z sebb $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static DateFormatDeprecated.Used to format timesstatic final intDeprecated.Enable all logging levelsstatic final intDeprecated."Debug" level logging.static final intDeprecated."Error" level logging.static final intDeprecated."Fatal" level logging.static final intDeprecated."Info" level logging.static final intDeprecated.Enable no logging levelsstatic final intDeprecated."Trace" level logging.static final intDeprecated."Warn" level logging.protected static intDeprecated.The current log levelprotected StringDeprecated.The name of this simple log instanceprotected static final StringDeprecated.protected static booleanDeprecated.Include the current time in the log messageprotected static booleanDeprecated.Include the instance name in the log message?protected static booleanDeprecated.Include the short name ( last component ) of the logger in the log message. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidDeprecated.Log a message with debug log level.final voidDeprecated.Log an error with debug log level.final voidDeprecated.Log a message with error log level.final voidDeprecated.Log an error with error log level.final voidDeprecated.Log a message with fatal log level.final voidDeprecated.Log an error with fatal log level.static intgetLevel()Deprecated.Get logging level.final voidDeprecated.Log a message with info log level.final voidDeprecated.Log an error with info log level.final booleanDeprecated.Are debug messages currently enabled?final booleanDeprecated.Are error messages currently enabled?final booleanDeprecated.Are fatal messages currently enabled?final booleanDeprecated.Are info messages currently enabled?protected static booleanisLevelEnabled(int level) Deprecated.Is the given log level currently enabled?final booleanDeprecated.Are trace messages currently enabled?final booleanDeprecated.Are warn messages currently enabled?protected voidDeprecated.Do the actual logging.static voidsetLevel(int currentLogLevel) Deprecated.Set logging level.final voidDeprecated.Log a message with debug log level.final voidDeprecated.Log an error with debug log level.final voidDeprecated.Log a message with warn log level.final voidDeprecated.Log an error with warn log level.
-
Field Details
-
LOG_LEVEL_TRACE
-
LOG_LEVEL_DEBUG
-
LOG_LEVEL_INFO
-
LOG_LEVEL_WARN
-
LOG_LEVEL_ERROR
-
LOG_LEVEL_FATAL
-
LOG_LEVEL_ALL
-
LOG_LEVEL_OFF
-
PROP_LEVEL
-
showLogName
-
showShortName
Deprecated.Include the short name ( last component ) of the logger in the log message. Default to true - otherwise we'll be lost in a flood of messages without knowing who sends them. -
showDateTime
-
dateFormatter
-
logLevel
-
logName
-
-
Constructor Details
-
SimpleLog
-
-
Method Details
-
setLevel
Deprecated.Set logging level.
- Parameters:
currentLogLevel- new logging level
-
getLevel
-
isLevelEnabled
Deprecated.Is the given log level currently enabled?- Parameters:
level- is this level enabled?- Returns:
- true, if the input level is enabled, false otherwise
-
log
-
debug
-
debug
-
trace
-
trace
-
info
-
info
-
warn
-
warn
-
error
-
error
-
fatal
-
fatal
-
isDebugEnabled
Deprecated.Are debug messages currently enabled?
This allows expensive operations such as
Stringconcatenation to be avoided when the message will be ignored by the logger.- Specified by:
isDebugEnabledin interfaceorg.apache.commons.logging.Log- Returns:
- true, if the
LOG_LEVEL_DEBUGis enabled, false otherwise
-
isErrorEnabled
Deprecated.Are error messages currently enabled?
This allows expensive operations such as
Stringconcatenation to be avoided when the message will be ignored by the logger.- Specified by:
isErrorEnabledin interfaceorg.apache.commons.logging.Log- Returns:
- true, if the
LOG_LEVEL_ERRORis enabled, false otherwise
-
isFatalEnabled
Deprecated.Are fatal messages currently enabled?
This allows expensive operations such as
Stringconcatenation to be avoided when the message will be ignored by the logger.- Specified by:
isFatalEnabledin interfaceorg.apache.commons.logging.Log- Returns:
- true, if the
LOG_LEVEL_FATALis enabled, false otherwise
-
isInfoEnabled
Deprecated.Are info messages currently enabled?
This allows expensive operations such as
Stringconcatenation to be avoided when the message will be ignored by the logger.- Specified by:
isInfoEnabledin interfaceorg.apache.commons.logging.Log- Returns:
- true, if the
LOG_LEVEL_INFOis enabled, false otherwise
-
isTraceEnabled
Deprecated.Are trace messages currently enabled?
This allows expensive operations such as
Stringconcatenation to be avoided when the message will be ignored by the logger.- Specified by:
isTraceEnabledin interfaceorg.apache.commons.logging.Log- Returns:
- true, if the
LOG_LEVEL_TRACEis enabled, false otherwise
-
isWarnEnabled
Deprecated.Are warn messages currently enabled?
This allows expensive operations such as
Stringconcatenation to be avoided when the message will be ignored by the logger.- Specified by:
isWarnEnabledin interfaceorg.apache.commons.logging.Log- Returns:
- true, if the
LOG_LEVEL_WARNis enabled, false otherwise
-