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
Deprecated."Trace" level logging.- See Also:
-
LOG_LEVEL_DEBUG
Deprecated."Debug" level logging.- See Also:
-
LOG_LEVEL_INFO
Deprecated."Info" level logging.- See Also:
-
LOG_LEVEL_WARN
Deprecated."Warn" level logging.- See Also:
-
LOG_LEVEL_ERROR
Deprecated."Error" level logging.- See Also:
-
LOG_LEVEL_FATAL
Deprecated."Fatal" level logging.- See Also:
-
LOG_LEVEL_ALL
Deprecated.Enable all logging levels- See Also:
-
LOG_LEVEL_OFF
Deprecated.Enable no logging levels- See Also:
-
PROP_LEVEL
Deprecated.- See Also:
-
showLogName
Deprecated.Include the instance name in the log message? -
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
Deprecated.Include the current time in the log message -
dateFormatter
Deprecated.Used to format times -
logLevel
Deprecated.The current log level -
logName
Deprecated.The name of this simple log instance
-
-
Constructor Details
-
SimpleLog
Deprecated.Construct a simple log with given name.- Parameters:
name- log name
-
-
Method Details
-
setLevel
Deprecated.Set logging level.
- Parameters:
currentLogLevel- new logging level
-
getLevel
Deprecated.Get logging level.- Returns:
- The logging level
-
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
Deprecated.Do the actual logging. This method assembles the message and then prints toSystem.err.- Parameters:
type- The logging levelmessage- The message to logt- The error cause, if any
-
debug
Deprecated.Log a message with debug log level.- Specified by:
debugin interfaceorg.apache.commons.logging.Log- Parameters:
message- The message to log
-
debug
Deprecated.Log an error with debug log level.- Specified by:
debugin interfaceorg.apache.commons.logging.Log- Parameters:
message- The message to logt- The error cause, if any
-
trace
Deprecated.Log a message with debug log level.- Specified by:
tracein interfaceorg.apache.commons.logging.Log- Parameters:
message- The message to log
-
trace
Deprecated.Log an error with debug log level.- Specified by:
tracein interfaceorg.apache.commons.logging.Log- Parameters:
message- The message to logt- The error cause, if any
-
info
Deprecated.Log a message with info log level.- Specified by:
infoin interfaceorg.apache.commons.logging.Log- Parameters:
message- The message to log
-
info
Deprecated.Log an error with info log level.- Specified by:
infoin interfaceorg.apache.commons.logging.Log- Parameters:
message- The message to logt- The error cause, if any
-
warn
Deprecated.Log a message with warn log level.- Specified by:
warnin interfaceorg.apache.commons.logging.Log- Parameters:
message- The message to log
-
warn
Deprecated.Log an error with warn log level.- Specified by:
warnin interfaceorg.apache.commons.logging.Log- Parameters:
message- The message to logt- The error cause, if any
-
error
Deprecated.Log a message with error log level.- Specified by:
errorin interfaceorg.apache.commons.logging.Log- Parameters:
message- The message to log
-
error
Deprecated.Log an error with error log level.- Specified by:
errorin interfaceorg.apache.commons.logging.Log- Parameters:
message- The message to logt- The error cause, if any
-
fatal
Deprecated.Log a message with fatal log level.- Specified by:
fatalin interfaceorg.apache.commons.logging.Log- Parameters:
message- The message to log
-
fatal
Deprecated.Log an error with fatal log level.- Specified by:
fatalin interfaceorg.apache.commons.logging.Log- Parameters:
message- The message to logt- The error cause, if any
-
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
-