Log4j 1.3alpha-6

org.apache.ugli.impl
Class SimpleLogger

java.lang.Object
  |
  +--org.apache.ugli.impl.SimpleLogger
All Implemented Interfaces:
ULogger

public class SimpleLogger
extends java.lang.Object
implements ULogger

A simple implementation that logs messages of level INFO or higher on the console (System.out).

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.

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 SortAlgo.DUMP - Dump of interger array:
317 [main] INFO SortAlgo.DUMP - Element [0] = 0
331 [main] INFO SortAlgo.DUMP - Element [1] = 1
343 [main] INFO examples.Sort - The next log statement should be an error message.
346 [main] ERROR SortAlgo.DUMP - 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ü

Field Summary
static java.lang.String LINE_SEPARATOR
           
 
Method Summary
 void debug(java.lang.Object msg)
          A NOP implementation.
 void debug(java.lang.Object parameterizedMsg, java.lang.Object param1)
          A NOP implementation.
 void debug(java.lang.Object msg, java.lang.Throwable t)
          A NOP implementation.
 void debug(java.lang.String parameterizedMsg, java.lang.Object param1, java.lang.Object param2)
          A NOP implementation.
 void error(java.lang.Object msg)
          A simple implementation which always logs messages of level ERROR acoording to the format outlined above.
 void error(java.lang.Object parameterizedMsg, java.lang.Object param1)
          Perform single parameter substituion before logging the message of level ERROR according to the format outlined above.
 void error(java.lang.Object msg, java.lang.Throwable t)
          Log a message of level ERROR, including an exception.
 void error(java.lang.String parameterizedMsg, java.lang.Object param1, java.lang.Object param2)
          Perform double parameter substituion before logging the message of level ERROR according to the format outlined above.
 void info(java.lang.Object msg)
          A simple implementation which always logs messages of level INFO according to the format outlined above.
 void info(java.lang.Object parameterizedMsg, java.lang.Object param1)
          Perform single parameter substituion before logging the message of level INFO according to the format outlined above.
 void info(java.lang.Object msg, java.lang.Throwable t)
          Log a message of level INFO, including an exception.
 void info(java.lang.String parameterizedMsg, java.lang.Object param1, java.lang.Object param2)
          Perform double parameter substituion before logging the message of level INFO according to the format outlined above.
 boolean isDebugEnabled()
          Always returns false.
 boolean isErrorEnabled()
          Always returns true.
 boolean isInfoEnabled()
          Always returns true.
 boolean isWarnEnabled()
          Always returns true.
 void warn(java.lang.Object msg)
          A simple implementation which always logs messages of level WARN according to the format outlined above.
 void warn(java.lang.Object parameterizedMsg, java.lang.Object param1)
          Perform single parameter substituion before logging the message of level WARN according to the format outlined above.
 void warn(java.lang.Object msg, java.lang.Throwable t)
          Log a message of level WARN, including an exception.
 void warn(java.lang.String parameterizedMsg, java.lang.Object param1, java.lang.Object param2)
          Perform double parameter substituion before logging the message of level WARN according to the format outlined above.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

public static final java.lang.String LINE_SEPARATOR
Method Detail

isDebugEnabled

public boolean isDebugEnabled()
Always returns false.

Specified by:
isDebugEnabled in interface ULogger
Returns:

debug

public void debug(java.lang.Object msg)
A NOP implementation.

Specified by:
debug in interface ULogger
Parameters:
msg - - the message object to be logged

debug

public void debug(java.lang.Object parameterizedMsg,
                  java.lang.Object param1)
A NOP implementation.

Specified by:
debug in interface ULogger
Parameters:
parameterizedMsg - - the parameterized message object
param1 - - the parameter

debug

public void debug(java.lang.String parameterizedMsg,
                  java.lang.Object param1,
                  java.lang.Object param2)
A NOP implementation.

Specified by:
debug in interface ULogger
Parameters:
parameterizedMsg - - the parameterized message object
param1 - - the first parameter
param2 - - the second parameter

debug

public void debug(java.lang.Object msg,
                  java.lang.Throwable t)
A NOP implementation.

Specified by:
debug in interface ULogger

isInfoEnabled

public boolean isInfoEnabled()
Always returns true.

Specified by:
isInfoEnabled in interface ULogger

info

public void info(java.lang.Object msg)
A simple implementation which always logs messages of level INFO according to the format outlined above.

Specified by:
info in interface ULogger

info

public void info(java.lang.Object parameterizedMsg,
                 java.lang.Object param1)
Perform single parameter substituion before logging the message of level INFO according to the format outlined above.

Specified by:
info in interface ULogger

info

public void info(java.lang.String parameterizedMsg,
                 java.lang.Object param1,
                 java.lang.Object param2)
Perform double parameter substituion before logging the message of level INFO according to the format outlined above.

Specified by:
info in interface ULogger

info

public void info(java.lang.Object msg,
                 java.lang.Throwable t)
Log a message of level INFO, including an exception.

Specified by:
info in interface ULogger

isWarnEnabled

public boolean isWarnEnabled()
Always returns true.

Specified by:
isWarnEnabled in interface ULogger

warn

public void warn(java.lang.Object msg)
A simple implementation which always logs messages of level WARN according to the format outlined above.

Specified by:
warn in interface ULogger

warn

public void warn(java.lang.Object parameterizedMsg,
                 java.lang.Object param1)
Perform single parameter substituion before logging the message of level WARN according to the format outlined above.

Specified by:
warn in interface ULogger

warn

public void warn(java.lang.String parameterizedMsg,
                 java.lang.Object param1,
                 java.lang.Object param2)
Perform double parameter substituion before logging the message of level WARN according to the format outlined above.

Specified by:
warn in interface ULogger

warn

public void warn(java.lang.Object msg,
                 java.lang.Throwable t)
Log a message of level WARN, including an exception.

Specified by:
warn in interface ULogger

isErrorEnabled

public boolean isErrorEnabled()
Always returns true.

Specified by:
isErrorEnabled in interface ULogger

error

public void error(java.lang.Object msg)
A simple implementation which always logs messages of level ERROR acoording to the format outlined above.

Specified by:
error in interface ULogger

error

public void error(java.lang.Object parameterizedMsg,
                  java.lang.Object param1)
Perform single parameter substituion before logging the message of level ERROR according to the format outlined above.

Specified by:
error in interface ULogger

error

public void error(java.lang.String parameterizedMsg,
                  java.lang.Object param1,
                  java.lang.Object param2)
Perform double parameter substituion before logging the message of level ERROR according to the format outlined above.

Specified by:
error in interface ULogger

error

public void error(java.lang.Object msg,
                  java.lang.Throwable t)
Log a message of level ERROR, including an exception.

Specified by:
error in interface ULogger

Log4j 1.3alpha-6

Copyright 2000-2005 Apache Software Foundation.