|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.discovery.log.SimpleLog
@Deprecated public class SimpleLog
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.
Field Summary | |
---|---|
protected static DateFormat |
dateFormatter
Deprecated. Used to format times |
static int |
LOG_LEVEL_ALL
Deprecated. Enable all logging levels |
static int |
LOG_LEVEL_DEBUG
Deprecated. "Debug" level logging. |
static int |
LOG_LEVEL_ERROR
Deprecated. "Error" level logging. |
static int |
LOG_LEVEL_FATAL
Deprecated. "Fatal" level logging. |
static int |
LOG_LEVEL_INFO
Deprecated. "Info" level logging. |
static int |
LOG_LEVEL_OFF
Deprecated. Enable no logging levels |
static int |
LOG_LEVEL_TRACE
Deprecated. "Trace" level logging. |
static int |
LOG_LEVEL_WARN
Deprecated. "Warn" level logging. |
protected static int |
logLevel
Deprecated. The current log level |
protected String |
logName
Deprecated. The name of this simple log instance |
protected static String |
PROP_LEVEL
Deprecated. |
protected static boolean |
showDateTime
Deprecated. Include the current time in the log message |
protected static boolean |
showLogName
Deprecated. Include the instance name in the log message? |
protected static boolean |
showShortName
Deprecated. Include the short name ( last component ) of the logger in the log message. |
Constructor Summary | |
---|---|
SimpleLog(String name)
Deprecated. Construct a simple log with given name. |
Method Summary | |
---|---|
void |
debug(Object message)
Deprecated. Log a message with debug log level. |
void |
debug(Object message,
Throwable t)
Deprecated. Log an error with debug log level. |
void |
error(Object message)
Deprecated. Log a message with error log level. |
void |
error(Object message,
Throwable t)
Deprecated. Log an error with error log level. |
void |
fatal(Object message)
Deprecated. Log a message with fatal log level. |
void |
fatal(Object message,
Throwable t)
Deprecated. Log an error with fatal log level. |
static int |
getLevel()
Deprecated. Get logging level. |
void |
info(Object message)
Deprecated. Log a message with info log level. |
void |
info(Object message,
Throwable t)
Deprecated. Log an error with info log level. |
boolean |
isDebugEnabled()
Deprecated. Are debug messages currently enabled? |
boolean |
isErrorEnabled()
Deprecated. Are error messages currently enabled? |
boolean |
isFatalEnabled()
Deprecated. Are fatal messages currently enabled? |
boolean |
isInfoEnabled()
Deprecated. Are info messages currently enabled? |
protected static boolean |
isLevelEnabled(int level)
Deprecated. Is the given log level currently enabled? |
boolean |
isTraceEnabled()
Deprecated. Are trace messages currently enabled? |
boolean |
isWarnEnabled()
Deprecated. Are warn messages currently enabled? |
protected void |
log(int type,
Object message,
Throwable t)
Deprecated. Do the actual logging. |
static void |
setLevel(int currentLogLevel)
Deprecated. Set logging level. |
void |
trace(Object message)
Deprecated. Log a message with debug log level. |
void |
trace(Object message,
Throwable t)
Deprecated. Log an error with debug log level. |
void |
warn(Object message)
Deprecated. Log a message with warn log level. |
void |
warn(Object message,
Throwable t)
Deprecated. Log an error with warn log level. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LOG_LEVEL_TRACE
public static final int LOG_LEVEL_DEBUG
public static final int LOG_LEVEL_INFO
public static final int LOG_LEVEL_WARN
public static final int LOG_LEVEL_ERROR
public static final int LOG_LEVEL_FATAL
public static final int LOG_LEVEL_ALL
public static final int LOG_LEVEL_OFF
protected static final String PROP_LEVEL
protected static boolean showLogName
protected static boolean showShortName
protected static boolean showDateTime
protected static DateFormat dateFormatter
protected static int logLevel
protected String logName
Constructor Detail |
---|
public SimpleLog(String name)
name
- log nameMethod Detail |
---|
public static void setLevel(int currentLogLevel)
Set logging level.
currentLogLevel
- new logging levelpublic static int getLevel()
protected static boolean isLevelEnabled(int level)
level
- is this level enabled?
protected void log(int type, Object message, Throwable t)
System.err
.
type
- The logging levelmessage
- The message to logt
- The error cause, if anypublic final void debug(Object message)
debug
in interface org.apache.commons.logging.Log
message
- The message to logpublic final void debug(Object message, Throwable t)
debug
in interface org.apache.commons.logging.Log
message
- The message to logt
- The error cause, if anypublic final void trace(Object message)
trace
in interface org.apache.commons.logging.Log
message
- The message to logpublic final void trace(Object message, Throwable t)
trace
in interface org.apache.commons.logging.Log
message
- The message to logt
- The error cause, if anypublic final void info(Object message)
info
in interface org.apache.commons.logging.Log
message
- The message to logpublic final void info(Object message, Throwable t)
info
in interface org.apache.commons.logging.Log
message
- The message to logt
- The error cause, if anypublic final void warn(Object message)
warn
in interface org.apache.commons.logging.Log
message
- The message to logpublic final void warn(Object message, Throwable t)
warn
in interface org.apache.commons.logging.Log
message
- The message to logt
- The error cause, if anypublic final void error(Object message)
error
in interface org.apache.commons.logging.Log
message
- The message to logpublic final void error(Object message, Throwable t)
error
in interface org.apache.commons.logging.Log
message
- The message to logt
- The error cause, if anypublic final void fatal(Object message)
fatal
in interface org.apache.commons.logging.Log
message
- The message to logpublic final void fatal(Object message, Throwable t)
fatal
in interface org.apache.commons.logging.Log
message
- The message to logt
- The error cause, if anypublic final boolean isDebugEnabled()
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.
isDebugEnabled
in interface org.apache.commons.logging.Log
LOG_LEVEL_DEBUG
is enabled, false otherwisepublic final boolean isErrorEnabled()
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.
isErrorEnabled
in interface org.apache.commons.logging.Log
LOG_LEVEL_ERROR
is enabled, false otherwisepublic final boolean isFatalEnabled()
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.
isFatalEnabled
in interface org.apache.commons.logging.Log
LOG_LEVEL_FATAL
is enabled, false otherwisepublic final boolean isInfoEnabled()
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.
isInfoEnabled
in interface org.apache.commons.logging.Log
LOG_LEVEL_INFO
is enabled, false otherwisepublic final boolean isTraceEnabled()
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.
isTraceEnabled
in interface org.apache.commons.logging.Log
LOG_LEVEL_TRACE
is enabled, false otherwisepublic final boolean isWarnEnabled()
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.
isWarnEnabled
in interface org.apache.commons.logging.Log
LOG_LEVEL_WARN
is enabled, false otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |