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
static java.util.logging.Level DEBUG
           
static java.lang.String DEFAULT_STREAM
           
protected static java.io.Writer defaultStream
           
static java.util.logging.Level ERROR
           
static java.util.logging.Level FULL_DEBUG
           
static java.util.logging.Level INFO
           
protected static boolean initialised
           
static java.util.logging.Level MAX
           
static java.util.logging.Level MIN
           
protected static java.util.Map namedStreams
           
protected static java.text.DateFormat sdfLog
           
protected static java.lang.Boolean semaphore
           
protected static boolean showThrowingThread
           
static java.util.logging.Level SPEED
           
static java.util.logging.Level 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)
           
static void init(java.util.logging.Level level)
          Initialises default streams
static void init(java.util.logging.Level level, java.io.OutputStream defaultStream, boolean showThrowingThreadArg)
          Initialises default streams
static void log(java.util.logging.Level level, WinstoneResourceBundle resources, java.lang.String messageKey)
           
static void log(java.util.logging.Level level, WinstoneResourceBundle resources, java.lang.String messageKey, java.lang.Object... params)
           
static void log(java.util.logging.Level level, WinstoneResourceBundle resources, java.lang.String messageKey, java.lang.Object param)
           
static void log(java.util.logging.Level level, WinstoneResourceBundle resources, java.lang.String messageKey, java.lang.Object[] params, java.lang.Throwable error)
           
static void log(java.util.logging.Level level, WinstoneResourceBundle resources, java.lang.String messageKey, java.lang.Object param, java.lang.Throwable error)
           
static void log(java.util.logging.Level level, WinstoneResourceBundle resources, java.lang.String streamName, java.lang.String messageKey, java.lang.Object[] params, java.lang.Throwable error)
           
static void log(java.util.logging.Level level, WinstoneResourceBundle resources, java.lang.String messageKey, java.lang.Throwable error)
           
static void logDirectMessage(java.util.logging.Level 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 java.util.logging.Level MIN

ERROR

public static java.util.logging.Level ERROR

WARNING

public static java.util.logging.Level WARNING

INFO

public static java.util.logging.Level INFO

SPEED

public static java.util.logging.Level SPEED

DEBUG

public static java.util.logging.Level DEBUG

FULL_DEBUG

public static java.util.logging.Level FULL_DEBUG

MAX

public static java.util.logging.Level 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

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(java.util.logging.Level level)
Initialises default streams


init

public static void init(int level)

init

public static void init(java.util.logging.Level 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(java.util.logging.Level level,
                       WinstoneResourceBundle resources,
                       java.lang.String messageKey)

log

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

log

public static void log(java.util.logging.Level level,
                       WinstoneResourceBundle resources,
                       java.lang.String messageKey,
                       java.lang.Object param)

log

public static void log(java.util.logging.Level level,
                       WinstoneResourceBundle resources,
                       java.lang.String messageKey,
                       java.lang.Object... params)

log

public static void log(java.util.logging.Level level,
                       WinstoneResourceBundle resources,
                       java.lang.String messageKey,
                       java.lang.Object param,
                       java.lang.Throwable error)

log

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

log

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

logDirectMessage

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


Copyright © 2013. All Rights Reserved.