CTL
Class Logger

java.lang.Object
  extended by CTL.Logger

public class Logger
extends java.lang.Object

Filter-based logging class


Field Summary
static int ALL
          All information
static int DBG
          Debugging information, level 0
static int DBG1
          Debugging information, level 1
static int DBG2
          Debugging information, level 2
static int ERR
          Error
private  java.io.FileWriter file
          The file to write to
static int INFO
          Information
private static int loglevel
          Filter level of this Logger (default: anything equally or more important than warning)
static int WARN
          Warning
 
Constructor Summary
private Logger(java.lang.String fname)
          Generate a new Logger with default filter
  Logger(java.lang.String fname, int loglevel)
          Generate a new Logger with user-defined filter treshold
 
Method Summary
 void close()
          Close the underlying file
private static java.lang.String gettimeofday(boolean foo)
          Determine current time
static void main(java.lang.String[] args)
           
 void msg(int lvl, java.lang.String msg)
          Write a message to the logfile
 void msg(java.lang.String msg)
          Write a message to the logfile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERR

public static final int ERR
Error

See Also:
Constant Field Values

WARN

public static final int WARN
Warning

See Also:
Constant Field Values

INFO

public static final int INFO
Information

See Also:
Constant Field Values

DBG

public static final int DBG
Debugging information, level 0

See Also:
Constant Field Values

DBG1

public static final int DBG1
Debugging information, level 1

See Also:
Constant Field Values

DBG2

public static final int DBG2
Debugging information, level 2

See Also:
Constant Field Values

ALL

public static final int ALL
All information

See Also:
Constant Field Values

file

private java.io.FileWriter file
The file to write to


loglevel

private static int loglevel
Filter level of this Logger (default: anything equally or more important than warning)

Constructor Detail

Logger

private Logger(java.lang.String fname)
Generate a new Logger with default filter

Parameters:
fname - Logfile

Logger

public Logger(java.lang.String fname,
              int loglevel)
Generate a new Logger with user-defined filter treshold

Parameters:
fname - Logfile
loglevel - Filter treshold
Method Detail

close

public void close()
Close the underlying file


msg

public void msg(int lvl,
                java.lang.String msg)
Write a message to the logfile

Parameters:
lvl - Importance of this message, if equally or more important than the filter treshold, it will be logged
msg - Log message

msg

public void msg(java.lang.String msg)
Write a message to the logfile

Parameters:
msg - Log message

gettimeofday

private static java.lang.String gettimeofday(boolean foo)
Determine current time

Returns:
Pretty-printed string containing the time of day

main

public static void main(java.lang.String[] args)