org.slf4j.impl
Class SimpleLogger
java.lang.Object
org.slf4j.helpers.MarkerIgnoringBase
org.slf4j.impl.SimpleLogger
- All Implemented Interfaces:
- Serializable, Logger
public class SimpleLogger
- extends MarkerIgnoringBase
A simple (and direct) implementation that logs messages of level INFO or
higher on the console (System.err).
The output includes the relative time in milliseconds, thread
name, the level, logger name, and the message followed by the line
separator for the host. In log4j terms it amounts to the "%r [%t]
%level %logger - %m%n" pattern.
Sample output follows.
176 [main] INFO examples.Sort - Populating an array of 2 elements in reverse order.
225 [main] INFO examples.SortAlgo - Entered the sort method.
304 [main] INFO examples.SortAlgo - Dump of integer array:
317 [main] INFO examples.SortAlgo - Element [0] = 0
331 [main] INFO examples.SortAlgo - Element [1] = 1
343 [main] INFO examples.Sort - The next log statement should be an error message.
346 [main] ERROR examples.SortAlgo - Tried to dump an uninitialized array.
at org.log4j.examples.SortAlgo.dump(SortAlgo.java:58)
at org.log4j.examples.Sort.main(Sort.java:64)
467 [main] INFO examples.Sort - Exiting main method.
- Author:
- Ceki Gülcü
- See Also:
- Serialized Form
Method Summary |
void |
debug(String msg)
A NOP implementation, as this logger is permanently disabled for the DEBUG
level. |
void |
debug(String format,
Object param1)
A NOP implementation, as this logger is permanently disabled for the DEBUG
level. |
void |
debug(String format,
Object[] argArray)
|
void |
debug(String format,
Object param1,
Object param2)
A NOP implementation, as this logger is permanently disabled for the DEBUG
level. |
void |
debug(String msg,
Throwable t)
A NOP implementation, as this logger is permanently disabled for the DEBUG
level. |
void |
error(String msg)
A simple implementation which always logs messages of level ERROR according
to the format outlined above. |
void |
error(String format,
Object arg)
Perform single parameter substitution before logging the message of level
ERROR according to the format outlined above. |
void |
error(String format,
Object[] argArray)
Perform double parameter substitution before logging the message of level
ERROR according to the format outlined above. |
void |
error(String format,
Object arg1,
Object arg2)
Perform double parameter substitution before logging the message of level
ERROR according to the format outlined above. |
void |
error(String msg,
Throwable t)
Log a message of level ERROR, including an exception. |
void |
info(String msg)
A simple implementation which always logs messages of level INFO according
to the format outlined above. |
void |
info(String format,
Object arg)
Perform single parameter substitution before logging the message of level
INFO according to the format outlined above. |
void |
info(String format,
Object[] argArray)
Perform double parameter substitution before logging the message of level
INFO according to the format outlined above. |
void |
info(String format,
Object arg1,
Object arg2)
Perform double parameter substitution before logging the message of level
INFO according to the format outlined above. |
void |
info(String msg,
Throwable t)
Log a message of level INFO, including an exception. |
boolean |
isDebugEnabled()
Always returns false. |
boolean |
isErrorEnabled()
Always returns true. |
boolean |
isInfoEnabled()
Always returns true. |
boolean |
isTraceEnabled()
Always returns false. |
boolean |
isWarnEnabled()
Always returns true. |
protected Object |
readResolve()
|
void |
trace(String msg)
A NOP implementation, as this logger is permanently disabled for the TRACE
level. |
void |
trace(String format,
Object param1)
A NOP implementation, as this logger is permanently disabled for the TRACE
level. |
void |
trace(String format,
Object[] argArray)
|
void |
trace(String format,
Object param1,
Object param2)
A NOP implementation, as this logger is permanently disabled for the TRACE
level. |
void |
trace(String msg,
Throwable t)
A NOP implementation, as this logger is permanently disabled for the TRACE
level. |
void |
warn(String msg)
A simple implementation which always logs messages of level WARN according
to the format outlined above. |
void |
warn(String format,
Object arg)
Perform single parameter substitution before logging the message of level
WARN according to the format outlined above. |
void |
warn(String format,
Object[] argArray)
Perform double parameter substitution before logging the message of level
WARN according to the format outlined above. |
void |
warn(String format,
Object arg1,
Object arg2)
Perform double parameter substitution before logging the message of level
WARN according to the format outlined above. |
void |
warn(String msg,
Throwable t)
Log a message of level WARN, including an exception. |
Methods inherited from class org.slf4j.helpers.MarkerIgnoringBase |
debug, debug, debug, debug, debug, error, error, error, error, error, info, info, info, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, toString, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn |
LINE_SEPARATOR
public static final String LINE_SEPARATOR
name
protected String name
isTraceEnabled
public boolean isTraceEnabled()
- Always returns false.
- Returns:
- always false
trace
public void trace(String msg)
- A NOP implementation, as this logger is permanently disabled for the TRACE
level.
trace
public void trace(String format,
Object param1)
- A NOP implementation, as this logger is permanently disabled for the TRACE
level.
trace
public void trace(String format,
Object param1,
Object param2)
- A NOP implementation, as this logger is permanently disabled for the TRACE
level.
trace
public void trace(String format,
Object[] argArray)
trace
public void trace(String msg,
Throwable t)
- A NOP implementation, as this logger is permanently disabled for the TRACE
level.
isDebugEnabled
public boolean isDebugEnabled()
- Always returns false.
- Returns:
- always false
debug
public void debug(String msg)
- A NOP implementation, as this logger is permanently disabled for the DEBUG
level.
debug
public void debug(String format,
Object param1)
- A NOP implementation, as this logger is permanently disabled for the DEBUG
level.
debug
public void debug(String format,
Object param1,
Object param2)
- A NOP implementation, as this logger is permanently disabled for the DEBUG
level.
debug
public void debug(String format,
Object[] argArray)
debug
public void debug(String msg,
Throwable t)
- A NOP implementation, as this logger is permanently disabled for the DEBUG
level.
isInfoEnabled
public boolean isInfoEnabled()
- Always returns true.
info
public void info(String msg)
- A simple implementation which always logs messages of level INFO according
to the format outlined above.
info
public void info(String format,
Object arg)
- Perform single parameter substitution before logging the message of level
INFO according to the format outlined above.
info
public void info(String format,
Object arg1,
Object arg2)
- Perform double parameter substitution before logging the message of level
INFO according to the format outlined above.
info
public void info(String format,
Object[] argArray)
- Perform double parameter substitution before logging the message of level
INFO according to the format outlined above.
info
public void info(String msg,
Throwable t)
- Log a message of level INFO, including an exception.
isWarnEnabled
public boolean isWarnEnabled()
- Always returns true.
warn
public void warn(String msg)
- A simple implementation which always logs messages of level WARN according
to the format outlined above.
warn
public void warn(String format,
Object arg)
- Perform single parameter substitution before logging the message of level
WARN according to the format outlined above.
warn
public void warn(String format,
Object arg1,
Object arg2)
- Perform double parameter substitution before logging the message of level
WARN according to the format outlined above.
warn
public void warn(String format,
Object[] argArray)
- Perform double parameter substitution before logging the message of level
WARN according to the format outlined above.
warn
public void warn(String msg,
Throwable t)
- Log a message of level WARN, including an exception.
isErrorEnabled
public boolean isErrorEnabled()
- Always returns true.
error
public void error(String msg)
- A simple implementation which always logs messages of level ERROR according
to the format outlined above.
error
public void error(String format,
Object arg)
- Perform single parameter substitution before logging the message of level
ERROR according to the format outlined above.
error
public void error(String format,
Object arg1,
Object arg2)
- Perform double parameter substitution before logging the message of level
ERROR according to the format outlined above.
error
public void error(String format,
Object[] argArray)
- Perform double parameter substitution before logging the message of level
ERROR according to the format outlined above.
error
public void error(String msg,
Throwable t)
- Log a message of level ERROR, including an exception.
readResolve
protected Object readResolve()
throws ObjectStreamException
- Throws:
ObjectStreamException
Copyright © 2005-2012 QOS.ch. All Rights Reserved.