marquee.xmlrpc.util
Class Log

java.lang.Object
  extended bymarquee.xmlrpc.util.Log

public class Log
extends java.lang.Object

A simple logging service that may be backed up with various storage devices and other types of logging devices (like the console or a socket).

Since:
JDK 1.1
Version:
$Revision: 1.4 $
Author:
Greger Ohlson (greger.ohlson@marquee.se)

Nested Class Summary
static class Log.DefaultLogBackEnd
          The default back end sends information to the console.
 
Constructor Summary
Log()
           
 
Method Summary
static void addBackEnd(LogBackEnd backEnd)
          Adds a LogBackEnd to the log.
static void append(java.lang.String type, java.lang.String message)
          Appends a message to all currently registered back ends.
static void append(java.lang.String type, java.lang.Throwable t)
          Appends an exception to the log back ends by converting it to a string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log

public Log()
Method Detail

addBackEnd

public static void addBackEnd(LogBackEnd backEnd)
Adds a LogBackEnd to the log. This backend will receive all log messages sent to this log service. Initially, the log service has a default back end registered which sends messages to the console. This will be replaced with the supplied back end on the first call. If the default back end should remain in the logger, it has to be reregistered.

Parameters:
backEnd - The back end to register. If this is the first call, this will replace the default back end.

append

public static void append(java.lang.String type,
                          java.lang.String message)
Appends a message to all currently registered back ends.

Parameters:
type - Some string indicating the message type. Application specific.
message - The log message.

append

public static void append(java.lang.String type,
                          java.lang.Throwable t)
Appends an exception to the log back ends by converting it to a string. If the default back end is still registered, it will handle the exception by extracting line number information from the exception

Parameters:
type - Type of message. Application specific.
t - The exception.