winstone
Class Logger

java.lang.Object
  extended by winstone.Logger

public class Logger
extends java.lang.Object

A utility class for logging event and status messages. It maintains a collection of streams for different types of messages, but any messages with unknown or unspecified stream go to the default stream.

Version:
$Id: Logger.java,v 1.8 2006/11/09 06:01:43 rickknowles Exp $
Author:
Rick Knowles

Field Summary
protected static int currentDebugLevel
           
static int DEBUG
           
static java.lang.String DEFAULT_STREAM
           
protected static java.io.Writer defaultStream
           
static int ERROR
           
static int FULL_DEBUG
           
static int INFO
           
protected static boolean initialised
           
static int MAX
           
static int MIN
           
protected static java.util.Map namedStreams
           
protected static java.text.DateFormat sdfLog
           
protected static java.lang.Boolean semaphore
           
protected static boolean showThrowingThread
           
static int SPEED
           
static int WARNING
           
 
Constructor Summary
Logger()
           
 
Method Summary
static void flush(java.lang.String name)
          Forces a flush of the contents to file, display, etc
static void init(int level)
          Initialises default streams
static void init(int level, java.io.OutputStream defaultStream, boolean showThrowingThreadArg)
          Initialises default streams
static void log(int level, WinstoneResourceBundle resources, java.lang.String messageKey)
           
static void log(int level, WinstoneResourceBundle resources, java.lang.String messageKey, java.lang.String param)
           
static void log(int level, WinstoneResourceBundle resources, java.lang.String messageKey, java.lang.String[] params)
           
static void log(int level, WinstoneResourceBundle resources, java.lang.String messageKey, java.lang.String[] params, java.lang.Throwable error)
           
static void log(int level, WinstoneResourceBundle resources, java.lang.String streamName, java.lang.String messageKey, java.lang.String[] params, java.lang.Throwable error)
           
static void log(int level, WinstoneResourceBundle resources, java.lang.String messageKey, java.lang.String param, java.lang.Throwable error)
           
static void log(int level, WinstoneResourceBundle resources, java.lang.String messageKey, java.lang.Throwable error)
           
static void logDirectMessage(int level, java.lang.String streamName, java.lang.String message, java.lang.Throwable error)
           
static void setCurrentDebugLevel(int level)
           
static void setStream(java.lang.String name, java.io.OutputStream stream)
          Allocates a stream for redirection to a file etc
static void setStream(java.lang.String name, java.io.Writer stream)
          Allocates a stream for redirection to a file etc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STREAM

public static final java.lang.String DEFAULT_STREAM
See Also:
Constant Field Values

MIN

public static int MIN

ERROR

public static int ERROR

WARNING

public static int WARNING

INFO

public static int INFO

SPEED

public static int SPEED

DEBUG

public static int DEBUG

FULL_DEBUG

public static int FULL_DEBUG

MAX

public static int MAX

semaphore

protected static java.lang.Boolean semaphore

initialised

protected static boolean initialised

defaultStream

protected static java.io.Writer defaultStream

namedStreams

protected static java.util.Map namedStreams

currentDebugLevel

protected static int currentDebugLevel

sdfLog

protected static final java.text.DateFormat sdfLog

showThrowingThread

protected static boolean showThrowingThread
Constructor Detail

Logger

public Logger()
Method Detail

init

public static void init(int level)
Initialises default streams


init

public static void init(int level,
                        java.io.OutputStream defaultStream,
                        boolean showThrowingThreadArg)
Initialises default streams


setStream

public static void setStream(java.lang.String name,
                             java.io.OutputStream stream)
Allocates a stream for redirection to a file etc


setStream

public static void setStream(java.lang.String name,
                             java.io.Writer stream)
Allocates a stream for redirection to a file etc


flush

public static void flush(java.lang.String name)
Forces a flush of the contents to file, display, etc


setCurrentDebugLevel

public static void setCurrentDebugLevel(int level)

log

public static void log(int level,
                       WinstoneResourceBundle resources,
                       java.lang.String messageKey)

log

public static void log(int level,
                       WinstoneResourceBundle resources,
                       java.lang.String messageKey,
                       java.lang.Throwable error)

log

public static void log(int level,
                       WinstoneResourceBundle resources,
                       java.lang.String messageKey,
                       java.lang.String param)

log

public static void log(int level,
                       WinstoneResourceBundle resources,
                       java.lang.String messageKey,
                       java.lang.String[] params)

log

public static void log(int level,
                       WinstoneResourceBundle resources,
                       java.lang.String messageKey,
                       java.lang.String param,
                       java.lang.Throwable error)

log

public static void log(int level,
                       WinstoneResourceBundle resources,
                       java.lang.String messageKey,
                       java.lang.String[] params,
                       java.lang.Throwable error)

log

public static void log(int level,
                       WinstoneResourceBundle resources,
                       java.lang.String streamName,
                       java.lang.String messageKey,
                       java.lang.String[] params,
                       java.lang.Throwable error)

logDirectMessage

public static void logDirectMessage(int level,
                                    java.lang.String streamName,
                                    java.lang.String message,
                                    java.lang.Throwable error)


Copyright © 2011. All Rights Reserved.