soaprmi.util.logging
Class Logger

java.lang.Object
  extended bysoaprmi.util.logging.Logger

public class Logger
extends java.lang.Object

miniLogger really small logger that is self-contained and very easy to use and configure from command line using system properties (or from inside of your application if you desire so).

Version:
$Revision: 1.23 $ $Date: 2003/05/19 03:38:03 $ (GMT)
Author:
Aleksander Slominski [http://www.extreme.indiana.edu/~aslom]

Field Summary
static int DEFAULT_NESTING_LEVEL
           
static Logger global
           
static java.lang.String PROPERTY_DEBUG
           
static java.lang.String PROPERTY_LOG
           
static java.lang.String PROPERTY_PREFIX
           
static java.lang.String PROPERTY_SHOWTIME
           
static java.lang.String PROPERTY_WRAPCOL
           
 
Method Summary
 java.lang.Throwable caught(java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.Throwable thrown)
           
 java.lang.Throwable caught(java.lang.Throwable thrown)
          report that exception was caught with log message at FINER level and "CAUGHT" message
 void config(java.lang.String msg)
           
 void config(java.lang.String msg, java.lang.Throwable thrown)
           
 void entering()
          Log a method entry with Level.FINER and message "ENTRY"
 void entering(java.lang.Object param1)
          Log a method entry with Level.FINER and message "ENTRY" and parametr content appended
 void entering(java.lang.Object[] params)
          Log a method entry with Level.FINER and message "ENTRY" and parametrs content appended
 void entering(java.lang.String sourceClass, java.lang.String sourceMethod)
           
 void entering(java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.Object param1)
           
 void entering(java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.Object[] params)
           
 void exiting()
          Log a method return with Level.FINER and message "RETURN"
 java.lang.Object exiting(java.lang.Object result)
          Log a method return with Level.FINER and message "RETURN" and return value appended
 void exiting(java.lang.String sourceClass, java.lang.String sourceMethod)
           
 java.lang.Object exiting(java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.Object result)
           
 void fine(java.lang.String msg)
           
 void fine(java.lang.String msg, java.lang.Throwable thrown)
           
 void finer(java.lang.String msg)
           
 void finer(java.lang.String msg, java.lang.Throwable thrown)
           
 void finest(java.lang.String msg)
           
 void finest(java.lang.String msg, java.lang.Throwable thrown)
           
static void formatTime(long time, java.lang.StringBuffer buf)
           
static Logger getAnonymousLogger()
           
 Level getLevel()
           
static Logger getLogger()
           
static Logger getLogger(java.lang.String name)
           
static boolean getMultiline()
           
 java.lang.String getName()
           
static boolean getShowTime()
           
static java.io.PrintStream getSink()
           
static int getWrapCol()
           
 void info(java.lang.String msg)
           
 void info(java.lang.String msg, java.lang.Throwable thrown)
           
 boolean isConfigEnabled()
           
 boolean isFineEnabled()
           
 boolean isFinerEnabled()
           
 boolean isFinestEnabled()
           
 boolean isInfoEnabled()
           
 boolean isLoggable(Level level)
           
 boolean isSevereEnabled()
           
 boolean isWariningEnabled()
           
 void log(Level level, java.lang.String msg)
           
 void log(Level level, java.lang.String msg, java.lang.Object param1)
           
 void log(Level level, java.lang.String msg, java.lang.Object[] params)
           
 void log(Level level, java.lang.String msg, java.lang.Throwable thrown)
           
 void logg(Level level, java.lang.String msg)
           
 void logg(Level level, java.lang.String msg, java.lang.Throwable thrown)
           
 void logg(Level level, java.lang.String msg, java.lang.Throwable thrown, int nestingLevel)
           
static java.lang.String parametersToList(java.lang.Object[] params)
           
static void setCmdNames(java.lang.String names)
          Enables list of loggers passed as string parameter.
 void setLevel(Level newLevel)
           
static void setMultiline(boolean enable)
           
static void setShowTime(boolean enable)
           
static void setSink(java.io.PrintStream ps)
           
static void setWrapCol(int i)
           
 void severe(java.lang.String msg)
           
 void severe(java.lang.String msg, java.lang.Throwable thrown)
           
 java.lang.Throwable throwing(java.lang.String sourceClass, java.lang.String sourceMethod, java.lang.Throwable thrown)
           
 java.lang.Throwable throwing(java.lang.Throwable thrown)
          Log an exception thrown with Level.FINER and message "THROW" and exception appended
 java.lang.String toString()
           
 void warning(java.lang.String msg)
           
 void warning(java.lang.String msg, java.lang.Throwable thrown)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

global

public static final Logger global

PROPERTY_PREFIX

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

PROPERTY_LOG

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

PROPERTY_SHOWTIME

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

PROPERTY_DEBUG

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

PROPERTY_WRAPCOL

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

DEFAULT_NESTING_LEVEL

public static final int DEFAULT_NESTING_LEVEL
See Also:
Constant Field Values
Method Detail

getAnonymousLogger

public static Logger getAnonymousLogger()

getLogger

public static Logger getLogger(java.lang.String name)

getLogger

public static Logger getLogger()

getName

public java.lang.String getName()

isLoggable

public boolean isLoggable(Level level)

isSevereEnabled

public final boolean isSevereEnabled()

isWariningEnabled

public final boolean isWariningEnabled()

isInfoEnabled

public final boolean isInfoEnabled()

isConfigEnabled

public final boolean isConfigEnabled()

isFineEnabled

public final boolean isFineEnabled()

isFinerEnabled

public final boolean isFinerEnabled()

isFinestEnabled

public final boolean isFinestEnabled()

setLevel

public void setLevel(Level newLevel)

getLevel

public Level getLevel()

parametersToList

public static java.lang.String parametersToList(java.lang.Object[] params)

entering

public void entering()
Log a method entry with Level.FINER and message "ENTRY"


entering

public void entering(java.lang.String sourceClass,
                     java.lang.String sourceMethod)

entering

public void entering(java.lang.Object param1)
Log a method entry with Level.FINER and message "ENTRY" and parametr content appended


entering

public void entering(java.lang.String sourceClass,
                     java.lang.String sourceMethod,
                     java.lang.Object param1)

entering

public void entering(java.lang.Object[] params)
Log a method entry with Level.FINER and message "ENTRY" and parametrs content appended


entering

public void entering(java.lang.String sourceClass,
                     java.lang.String sourceMethod,
                     java.lang.Object[] params)

exiting

public void exiting()
Log a method return with Level.FINER and message "RETURN"


exiting

public void exiting(java.lang.String sourceClass,
                    java.lang.String sourceMethod)

exiting

public java.lang.Object exiting(java.lang.Object result)
Log a method return with Level.FINER and message "RETURN" and return value appended


exiting

public java.lang.Object exiting(java.lang.String sourceClass,
                                java.lang.String sourceMethod,
                                java.lang.Object result)

throwing

public java.lang.Throwable throwing(java.lang.Throwable thrown)
Log an exception thrown with Level.FINER and message "THROW" and exception appended


throwing

public java.lang.Throwable throwing(java.lang.String sourceClass,
                                    java.lang.String sourceMethod,
                                    java.lang.Throwable thrown)

caught

public java.lang.Throwable caught(java.lang.Throwable thrown)
report that exception was caught with log message at FINER level and "CAUGHT" message


caught

public java.lang.Throwable caught(java.lang.String sourceClass,
                                  java.lang.String sourceMethod,
                                  java.lang.Throwable thrown)

severe

public void severe(java.lang.String msg)

warning

public void warning(java.lang.String msg)

info

public void info(java.lang.String msg)

config

public void config(java.lang.String msg)

fine

public void fine(java.lang.String msg)

finer

public void finer(java.lang.String msg)

finest

public void finest(java.lang.String msg)

log

public void log(Level level,
                java.lang.String msg)

log

public void log(Level level,
                java.lang.String msg,
                java.lang.Throwable thrown)

log

public void log(Level level,
                java.lang.String msg,
                java.lang.Object param1)

log

public void log(Level level,
                java.lang.String msg,
                java.lang.Object[] params)

severe

public void severe(java.lang.String msg,
                   java.lang.Throwable thrown)

warning

public void warning(java.lang.String msg,
                    java.lang.Throwable thrown)

info

public void info(java.lang.String msg,
                 java.lang.Throwable thrown)

config

public void config(java.lang.String msg,
                   java.lang.Throwable thrown)

fine

public void fine(java.lang.String msg,
                 java.lang.Throwable thrown)

finer

public void finer(java.lang.String msg,
                  java.lang.Throwable thrown)

finest

public void finest(java.lang.String msg,
                   java.lang.Throwable thrown)

getSink

public static java.io.PrintStream getSink()

setSink

public static void setSink(java.io.PrintStream ps)

logg

public void logg(Level level,
                 java.lang.String msg)

logg

public void logg(Level level,
                 java.lang.String msg,
                 java.lang.Throwable thrown)

logg

public void logg(Level level,
                 java.lang.String msg,
                 java.lang.Throwable thrown,
                 int nestingLevel)

setCmdNames

public static void setCmdNames(java.lang.String names)
Enables list of loggers passed as string parameter. Format: [logger_name:LEVEL][,...] logger_name is package[.class] or any name that was given when creating logger with Logger.getLogger("name"); LEVEL -s execatly name of Level such as ALL, FINE, etc. (see Level class)


getMultiline

public static boolean getMultiline()

setMultiline

public static void setMultiline(boolean enable)

getWrapCol

public static int getWrapCol()

setWrapCol

public static void setWrapCol(int i)

getShowTime

public static boolean getShowTime()

setShowTime

public static void setShowTime(boolean enable)

formatTime

public static void formatTime(long time,
                              java.lang.StringBuffer buf)

toString

public java.lang.String toString()


Copyright (c) 2004 IU Extreme! Lab http://www.extreme.indiana.edu/ All Rights Reserved.