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 DateFormat
Deprecated.Used to format timesstatic final int
Deprecated.Enable all logging levelsstatic final int
Deprecated."Debug" level logging.static final int
Deprecated."Error" level logging.static final int
Deprecated."Fatal" level logging.static final int
Deprecated."Info" level logging.static final int
Deprecated.Enable no logging levelsstatic final int
Deprecated."Trace" level logging.static final int
Deprecated."Warn" level logging.protected static int
Deprecated.The current log levelprotected String
Deprecated.The name of this simple log instanceprotected static final String
Deprecated.protected static boolean
Deprecated.Include the current time in the log messageprotected static boolean
Deprecated.Include the instance name in the log message?protected static boolean
Deprecated.Include the short name ( last component ) of the logger in the log message. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Deprecated.Log a message with debug log level.final void
Deprecated.Log an error with debug log level.final void
Deprecated.Log a message with error log level.final void
Deprecated.Log an error with error log level.final void
Deprecated.Log a message with fatal log level.final void
Deprecated.Log an error with fatal log level.static int
getLevel()
Deprecated.Get logging level.final void
Deprecated.Log a message with info log level.final void
Deprecated.Log an error with info log level.final boolean
Deprecated.Are debug messages currently enabled?final boolean
Deprecated.Are error messages currently enabled?final boolean
Deprecated.Are fatal messages currently enabled?final boolean
Deprecated.Are info messages currently enabled?protected static boolean
isLevelEnabled
(int level) Deprecated.Is the given log level currently enabled?final boolean
Deprecated.Are trace messages currently enabled?final boolean
Deprecated.Are warn messages currently enabled?protected void
Deprecated.Do the actual logging.static void
setLevel
(int currentLogLevel) Deprecated.Set logging level.final void
Deprecated.Log a message with debug log level.final void
Deprecated.Log an error with debug log level.final void
Deprecated.Log a message with warn log level.final void
Deprecated.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:
debug
in interfaceorg.apache.commons.logging.Log
- Parameters:
message
- The message to log
-
debug
Deprecated.Log an error with debug log level.- Specified by:
debug
in 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:
trace
in interfaceorg.apache.commons.logging.Log
- Parameters:
message
- The message to log
-
trace
Deprecated.Log an error with debug log level.- Specified by:
trace
in 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:
info
in interfaceorg.apache.commons.logging.Log
- Parameters:
message
- The message to log
-
info
Deprecated.Log an error with info log level.- Specified by:
info
in 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:
warn
in interfaceorg.apache.commons.logging.Log
- Parameters:
message
- The message to log
-
warn
Deprecated.Log an error with warn log level.- Specified by:
warn
in 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:
error
in interfaceorg.apache.commons.logging.Log
- Parameters:
message
- The message to log
-
error
Deprecated.Log an error with error log level.- Specified by:
error
in 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:
fatal
in interfaceorg.apache.commons.logging.Log
- Parameters:
message
- The message to log
-
fatal
Deprecated.Log an error with fatal log level.- Specified by:
fatal
in 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
String
concatenation to be avoided when the message will be ignored by the logger.- Specified by:
isDebugEnabled
in interfaceorg.apache.commons.logging.Log
- Returns:
- true, if the
LOG_LEVEL_DEBUG
is enabled, false otherwise
-
isErrorEnabled
Deprecated.Are error messages currently enabled?
This allows expensive operations such as
String
concatenation to be avoided when the message will be ignored by the logger.- Specified by:
isErrorEnabled
in interfaceorg.apache.commons.logging.Log
- Returns:
- true, if the
LOG_LEVEL_ERROR
is enabled, false otherwise
-
isFatalEnabled
Deprecated.Are fatal messages currently enabled?
This allows expensive operations such as
String
concatenation to be avoided when the message will be ignored by the logger.- Specified by:
isFatalEnabled
in interfaceorg.apache.commons.logging.Log
- Returns:
- true, if the
LOG_LEVEL_FATAL
is enabled, false otherwise
-
isInfoEnabled
Deprecated.Are info messages currently enabled?
This allows expensive operations such as
String
concatenation to be avoided when the message will be ignored by the logger.- Specified by:
isInfoEnabled
in interfaceorg.apache.commons.logging.Log
- Returns:
- true, if the
LOG_LEVEL_INFO
is enabled, false otherwise
-
isTraceEnabled
Deprecated.Are trace messages currently enabled?
This allows expensive operations such as
String
concatenation to be avoided when the message will be ignored by the logger.- Specified by:
isTraceEnabled
in interfaceorg.apache.commons.logging.Log
- Returns:
- true, if the
LOG_LEVEL_TRACE
is enabled, false otherwise
-
isWarnEnabled
Deprecated.Are warn messages currently enabled?
This allows expensive operations such as
String
concatenation to be avoided when the message will be ignored by the logger.- Specified by:
isWarnEnabled
in interfaceorg.apache.commons.logging.Log
- Returns:
- true, if the
LOG_LEVEL_WARN
is enabled, false otherwise
-