org.graphstream.util
Class Logger

java.lang.Object
  extended by org.graphstream.util.Logger

public class Logger
extends Object

Logger.

Since:
20061108
Author:
Frédéric Guinand, Yoann Pigné, Antoine Dutot

Nested Class Summary
static class Logger.LogLevel
          The different log levels.
 
Field Summary
static Logger GLOBAL_LOGGER
           
 
Constructor Summary
Logger()
           
 
Method Summary
static Logger getGlobalLogger()
          Return the shared global instance of the logger.
 void log(Logger.LogLevel level, String ref, Exception e)
          The method that every class of the package should use to send exception messages to the user.
 void log(Logger.LogLevel level, String ref, String message, Object... params)
          The method that every class of the package should use to send messages to the user.
 void setLogLevel(Logger.LogLevel level)
          Change the log level.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLOBAL_LOGGER

public static Logger GLOBAL_LOGGER
Constructor Detail

Logger

public Logger()
Method Detail

log

public void log(Logger.LogLevel level,
                String ref,
                Exception e)
The method that every class of the package should use to send exception messages to the user.

Parameters:
level - The log level of the message.
ref - The name of the class calling this method.
e - The exception to log.

log

public void log(Logger.LogLevel level,
                String ref,
                String message,
                Object... params)
The method that every class of the package should use to send messages to the user.

Parameters:
level - The log level of the message.
ref - The name of the class calling this method.
message - The message to log (can be in printf format).
params - The parameter of the message if in printf format.

setLogLevel

public void setLogLevel(Logger.LogLevel level)
Change the log level.

Parameters:
level - The new log level.

getGlobalLogger

public static Logger getGlobalLogger()
Return the shared global instance of the logger. This singleton instance is avaiable in the whole JVM.

Returns:
The singleton global instance of the logger.


Copyright © 2012. All Rights Reserved.