nl.tudelft.simulation.logger
Class Logger

java.lang.Object
  extended by nl.tudelft.simulation.logger.Logger

public final class Logger
extends Object

Provides a static class to Sun's logging framework.

(c) copyright 2002-2005 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.4
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:26:12 $
Author:
Peter Jacobs

Field Summary
static EventProducingMap LOGGERS
          loggers are the currently available loggers
 
Method Summary
static void config(Object caller, String methodName, String msg)
          configs a message
static void entering(Object caller, String arg0, String arg1)
          Logs a method entry.
static void entering(Object caller, String arg0, String arg1, Object arg2)
          Logs a method entry.
static void entering(Object caller, String arg0, String arg1, Object[] arg2)
          Logs a method entry.
static void exiting(Object caller, String arg0, String arg1)
          Logs a method exit.
static void exiting(Object caller, String arg0, String arg1, Object arg2)
          Logs a method exit.
static void fine(Object caller, String methodName, String msg)
          Logs a fine message
static void finer(Object caller, String methodName, String msg)
          Logs a finer message
static void finest(Object caller, String methodName, String msg)
          Logs a finest message
static Class getDefaultHandler()
           
static String[] getLoggerNames()
          returns the names of the currently used loggers
static Level getLogLevel()
           
static void info(Object caller, String methodName, String msg)
          Logs a info message
static void log(Object caller, Level arg0, String arg1)
          Logs a message
static void log(Object caller, Level arg0, String arg1, Object arg2)
          Logs a message, with associated parameter
static void log(Object caller, Level arg0, String arg1, Object[] arg2)
          Logs a message, with associated parameters
static void log(Object caller, Level arg0, String arg1, Throwable arg2)
          Logs a message, with associated throwable
static void log(Object caller, LogRecord arg0)
          Logs a log record
static void logp(Object caller, Level arg0, String arg1, String arg2, String arg3)
          Logs a message, with associated class information
static void logp(Object caller, Level arg0, String arg1, String arg2, String arg3, Object arg4)
          Logs a message, with associated parameter and class information
static void logp(Object caller, Level arg0, String arg1, String arg2, String arg3, Object[] arg4)
          Logs a message, with associated parameter and class information
static void logp(Object caller, Level arg0, String arg1, String arg2, String arg3, Throwable arg4)
          Logs a message, with associated throwable and class information
static void logrb(Object caller, Level arg0, String arg1, String arg2, String arg3, String arg4)
          Logs a message, with associated class information and resource bundle
static void logrb(Object caller, Level arg0, String arg1, String arg2, String arg3, String arg4, Object arg5)
          Logs a message, with associated parameter and class information and resource bundle
static void logrb(Object caller, Level arg0, String arg1, String arg2, String arg3, String arg4, Object[] arg5)
          Logs a message, with associated parameters and class information and resource bundle
static void logrb(Object caller, Level arg0, String arg1, String arg2, String arg3, String arg4, Throwable arg5)
          Logs a message, with associated throwable and class information and resource bundle
static Logger resolveLogger(Object caller)
          resolves the logger for a caller
static void setDefaultHandler(Class defaultHandler)
           
static void setLogLevel(Level logLevel)
           
static void severe(Object caller, String methodName, String msg)
          Logs a severe message
static void severe(Object caller, String methodName, Throwable throwable)
          Logs a severe message
static void throwing(Object caller, String arg0, String arg1, Throwable arg2)
          logs a throwable message
static void warning(Object caller, String methodName, String msg)
          Logs a warning message
static void warning(Object caller, String methodName, Throwable thrown)
          Logs a warning message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGERS

public static final EventProducingMap LOGGERS
loggers are the currently available loggers

Method Detail

resolveLogger

public static Logger resolveLogger(Object caller)
resolves the logger for a caller

Parameters:
caller - the object invoking the loggers
Returns:
Logger the logger

config

public static void config(Object caller,
                          String methodName,
                          String msg)
configs a message

Parameters:
caller - the caller
methodName - the name of the method
msg - the message

entering

public static void entering(Object caller,
                            String arg0,
                            String arg1,
                            Object arg2)
Logs a method entry.

Parameters:
caller - the object calling the logger
arg0 - the name of the class calling the method
arg1 - the name of the method entering
arg2 - parameter to the method being entered

entering

public static void entering(Object caller,
                            String arg0,
                            String arg1,
                            Object[] arg2)
Logs a method entry.

Parameters:
caller - the object calling the logger
arg0 - the name of the class calling the method
arg1 - the name of the method entering
arg2 - parameters to the method being entered

entering

public static void entering(Object caller,
                            String arg0,
                            String arg1)
Logs a method entry.

Parameters:
caller - the object calling the logger
arg0 - the name of the class calling the method
arg1 - the name of the method entering

exiting

public static void exiting(Object caller,
                           String arg0,
                           String arg1,
                           Object arg2)
Logs a method exit.

Parameters:
caller - the object calling the logger
arg0 - the name of the class calling the method
arg1 - the name of the method entering
arg2 - result of the method

exiting

public static void exiting(Object caller,
                           String arg0,
                           String arg1)
Logs a method exit.

Parameters:
caller - the object calling the logger
arg0 - the name of the class calling the method
arg1 - the name of the method entering

fine

public static void fine(Object caller,
                        String methodName,
                        String msg)
Logs a fine message

Parameters:
caller - the object calling the logger
methodName - the name of the method
msg - the message

finer

public static void finer(Object caller,
                         String methodName,
                         String msg)
Logs a finer message

Parameters:
caller - the object calling the logger
methodName - the name of the method
msg - the message

finest

public static void finest(Object caller,
                          String methodName,
                          String msg)
Logs a finest message

Parameters:
caller - the object calling the logger
methodName - the name of the method
msg - the message

getLoggerNames

public static String[] getLoggerNames()
returns the names of the currently used loggers

Returns:
String[] the names

info

public static void info(Object caller,
                        String methodName,
                        String msg)
Logs a info message

Parameters:
caller - the object calling the logger
methodName - the name of the method
msg - the message

log

public static void log(Object caller,
                       Level arg0,
                       String arg1,
                       Object arg2)
Logs a message, with associated parameter

Parameters:
caller - the object calling the logger
arg0 - the log level
arg1 - the message
arg2 - the parameter

log

public static void log(Object caller,
                       Level arg0,
                       String arg1,
                       Object[] arg2)
Logs a message, with associated parameters

Parameters:
caller - the object calling the logger
arg0 - the log level
arg1 - the message
arg2 - the parameters

log

public static void log(Object caller,
                       Level arg0,
                       String arg1,
                       Throwable arg2)
Logs a message, with associated throwable

Parameters:
caller - the object calling the logger
arg0 - the log level
arg1 - the message
arg2 - the throwable

log

public static void log(Object caller,
                       Level arg0,
                       String arg1)
Logs a message

Parameters:
caller - the object calling the logger
arg0 - the log level
arg1 - the message

log

public static void log(Object caller,
                       LogRecord arg0)
Logs a log record

Parameters:
caller - the object calling the logger
arg0 - the log record

logp

public static void logp(Object caller,
                        Level arg0,
                        String arg1,
                        String arg2,
                        String arg3,
                        Object arg4)
Logs a message, with associated parameter and class information

Parameters:
caller - the object calling the logger
arg0 - the log level
arg1 - the source class
arg2 - the method information
arg3 - the message
arg4 - the parameter

logp

public static void logp(Object caller,
                        Level arg0,
                        String arg1,
                        String arg2,
                        String arg3,
                        Object[] arg4)
Logs a message, with associated parameter and class information

Parameters:
caller - the object calling the logger
arg0 - the log level
arg1 - the source class
arg2 - the method information
arg3 - the message
arg4 - the parameters

logp

public static void logp(Object caller,
                        Level arg0,
                        String arg1,
                        String arg2,
                        String arg3,
                        Throwable arg4)
Logs a message, with associated throwable and class information

Parameters:
caller - the object calling the logger
arg0 - the log level
arg1 - the source class
arg2 - the method information
arg3 - the message
arg4 - the parameters

logp

public static void logp(Object caller,
                        Level arg0,
                        String arg1,
                        String arg2,
                        String arg3)
Logs a message, with associated class information

Parameters:
caller - the object calling the logger
arg0 - the log level
arg1 - the source class
arg2 - the method information
arg3 - the message

logrb

public static void logrb(Object caller,
                         Level arg0,
                         String arg1,
                         String arg2,
                         String arg3,
                         String arg4,
                         Object arg5)
Logs a message, with associated parameter and class information and resource bundle

Parameters:
caller - the object calling the logger
arg0 - the log level
arg1 - the source class
arg2 - the method information
arg3 - the resource bundle
arg4 - the message
arg5 - the parameter

logrb

public static void logrb(Object caller,
                         Level arg0,
                         String arg1,
                         String arg2,
                         String arg3,
                         String arg4,
                         Object[] arg5)
Logs a message, with associated parameters and class information and resource bundle

Parameters:
caller - the object calling the logger
arg0 - the log level
arg1 - the source class
arg2 - the method information
arg3 - the resource bundle
arg4 - the message
arg5 - the parameters

logrb

public static void logrb(Object caller,
                         Level arg0,
                         String arg1,
                         String arg2,
                         String arg3,
                         String arg4,
                         Throwable arg5)
Logs a message, with associated throwable and class information and resource bundle

Parameters:
caller - the object calling the logger
arg0 - the log level
arg1 - the source class
arg2 - the method information
arg3 - the resource bundle
arg4 - the message
arg5 - the parameters

logrb

public static void logrb(Object caller,
                         Level arg0,
                         String arg1,
                         String arg2,
                         String arg3,
                         String arg4)
Logs a message, with associated class information and resource bundle

Parameters:
caller - the object calling the logger
arg0 - the log level
arg1 - the source class
arg2 - the method information
arg3 - the resource bundle
arg4 - the message

severe

public static void severe(Object caller,
                          String methodName,
                          String msg)
Logs a severe message

Parameters:
caller - the object calling the logger
methodName - the name of the method
msg - the message

severe

public static void severe(Object caller,
                          String methodName,
                          Throwable throwable)
Logs a severe message

Parameters:
caller - the object calling the logger
methodName - the name of the method
throwable - the throwable

throwing

public static void throwing(Object caller,
                            String arg0,
                            String arg1,
                            Throwable arg2)
logs a throwable message

Parameters:
caller - the object invoking the logger
arg0 - the class
arg1 - the method
arg2 - the throwable

warning

public static void warning(Object caller,
                           String methodName,
                           String msg)
Logs a warning message

Parameters:
caller - the object calling the logger
methodName - the name of the method
msg - the message

warning

public static void warning(Object caller,
                           String methodName,
                           Throwable thrown)
Logs a warning message

Parameters:
caller - the object calling the logger
methodName - the name of the method
thrown - the thrown

getDefaultHandler

public static Class getDefaultHandler()
Returns:
Returns the defaultHandler.

setDefaultHandler

public static void setDefaultHandler(Class defaultHandler)
Parameters:
defaultHandler - The defaultHandler to set.

getLogLevel

public static Level getLogLevel()
Returns:
Returns the logLevel.

setLogLevel

public static void setLogLevel(Level logLevel)
Parameters:
logLevel - The logLevel to set.


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.