org.jmol.util
Class Logger

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

public final class Logger
extends java.lang.Object

Logger mechanism.


Field Summary
private static boolean[] _activeLevels
           
private static LoggerInterface _logger
           
private static boolean _logLevel
           
static boolean debugging
           
static boolean debuggingHigh
           
static int LEVEL_DEBUG
           
static int LEVEL_DEBUGHIGH
           
static int LEVEL_ERROR
           
static int LEVEL_FATAL
           
static int LEVEL_INFO
           
static int LEVEL_MAX
           
static int LEVEL_WARN
           
(package private) static long startTime
           
 
Constructor Summary
Logger()
           
 
Method Summary
static void checkMemory()
           
static long checkTimer(java.lang.String msg)
           
static void debug(java.lang.String txt)
          Writes a log at DEBUG level.
static void error(java.lang.String txt)
          Writes a log at ERROR level.
static void error(java.lang.String txt, java.lang.Throwable e)
          Writes a log at ERROR level with detail on exception.
static void fatal(java.lang.String txt)
          Writes a log at FATAL level.
static void fatal(java.lang.String txt, java.lang.Throwable e)
          Writes a log at FATAL level with detail on exception.
static java.lang.String getLevel(int level)
          Returns the text corresponding to a level.
static int getLogLevel()
           
private static boolean getProperty(java.lang.String level, boolean defaultValue)
           
static void info(java.lang.String txt)
          og* Writes a log at INFO level.
static boolean isActiveLevel(int level)
          Tells if a logging level is active.
static boolean logLevel()
          Indicates if the level is logged.
static void logLevel(boolean log)
          Indicates if the level is logged.
static void setActiveLevel(int level, boolean active)
          Changes the activation state for a logging level.
static void setLogger(LoggerInterface logger)
          Replaces the current logger implementation by a new one.
static void setLogLevel(int level)
          Activates all logging levels up through a given level.
static void startTimer()
           
static void warn(java.lang.String txt)
          Writes a log at WARN level.
static void warn(java.lang.String txt, java.lang.Throwable e)
          Writes a log at WARN level with detail on exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

private static LoggerInterface _logger

LEVEL_FATAL

public static final int LEVEL_FATAL
See Also:
Constant Field Values

LEVEL_ERROR

public static final int LEVEL_ERROR
See Also:
Constant Field Values

LEVEL_WARN

public static final int LEVEL_WARN
See Also:
Constant Field Values

LEVEL_INFO

public static final int LEVEL_INFO
See Also:
Constant Field Values

LEVEL_DEBUG

public static final int LEVEL_DEBUG
See Also:
Constant Field Values

LEVEL_DEBUGHIGH

public static final int LEVEL_DEBUGHIGH
See Also:
Constant Field Values

LEVEL_MAX

public static final int LEVEL_MAX
See Also:
Constant Field Values

_activeLevels

private static final boolean[] _activeLevels

_logLevel

private static boolean _logLevel

debugging

public static boolean debugging

debuggingHigh

public static boolean debuggingHigh

startTime

static long startTime
Constructor Detail

Logger

public Logger()
Method Detail

getProperty

private static boolean getProperty(java.lang.String level,
                                   boolean defaultValue)

setLogger

public static void setLogger(LoggerInterface logger)
Replaces the current logger implementation by a new one.

Parameters:
logger - New logger implementation.

isActiveLevel

public static boolean isActiveLevel(int level)
Tells if a logging level is active.

Parameters:
level - Logging level.
Returns:
Active.

setActiveLevel

public static void setActiveLevel(int level,
                                  boolean active)
Changes the activation state for a logging level.

Parameters:
level - Level.
active - New activation state.

setLogLevel

public static void setLogLevel(int level)
Activates all logging levels up through a given level.

Parameters:
level -

getLevel

public static java.lang.String getLevel(int level)
Returns the text corresponding to a level.

Parameters:
level - Level.
Returns:
Corresponding text.

logLevel

public static boolean logLevel()
Indicates if the level is logged.

Returns:
Indicator.

logLevel

public static void logLevel(boolean log)
Indicates if the level is logged.

Parameters:
log - Indicator.

debug

public static void debug(java.lang.String txt)
Writes a log at DEBUG level.

Parameters:
txt - String to write.

info

public static void info(java.lang.String txt)
og* Writes a log at INFO level.

Parameters:
txt - String to write.

warn

public static void warn(java.lang.String txt)
Writes a log at WARN level.

Parameters:
txt - String to write.

warn

public static void warn(java.lang.String txt,
                        java.lang.Throwable e)
Writes a log at WARN level with detail on exception.

Parameters:
txt - String to write.
e - Exception.

error

public static void error(java.lang.String txt)
Writes a log at ERROR level.

Parameters:
txt - String to write.

error

public static void error(java.lang.String txt,
                         java.lang.Throwable e)
Writes a log at ERROR level with detail on exception.

Parameters:
txt - String to write.
e - Exception.

getLogLevel

public static int getLogLevel()

fatal

public static void fatal(java.lang.String txt)
Writes a log at FATAL level.

Parameters:
txt - String to write.

fatal

public static void fatal(java.lang.String txt,
                         java.lang.Throwable e)
Writes a log at FATAL level with detail on exception.

Parameters:
txt - String to write.
e - Exception.

startTimer

public static void startTimer()

checkTimer

public static long checkTimer(java.lang.String msg)

checkMemory

public static void checkMemory()