jade.util
Class Logger

java.lang.Object
  |
  +--jade.util.Logger

public class Logger
extends java.lang.Object

This class provides a uniform way to produce logging printouts in a device dependent way. More in details if you are running JADE in a Java 2 standard edition environment or in a PersonalJava environment (through the LEAP add-on) a call to Logger.println() simply results in a call to System.out.println(). On the other hand if you are running JADE in a MIDP environment (again through the LEAP add-on) printouts are redirected so that they can be later viewed by means of the jade.util.leap.OutputViewer MIDlet included in the LEAP add-on.


Constructor Summary
Logger(java.lang.String id, int verbosity)
          Create a logger object with the given name and verbosity level.
Logger(java.lang.String id, int verbosity, java.lang.String timeFormat, java.lang.String logFormat)
          Create a logger object with a custom log format.
 
Method Summary
 void log(java.lang.String msg, int level)
          Log a given message if the level is <= than the verbosity level of this Logger object.
static void println()
          Print a new line on the log stream.
static void println(java.lang.String s)
          Print a String in a device dependent way.
 void setLogFormat(java.lang.String format)
          Define the log format of this Logger object.
 void setTimeFormat(java.lang.String format)
          Establish a time format for this logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Logger

public Logger(java.lang.String id,
              int verbosity)
Create a logger object with the given name and verbosity level.

Parameters:
id - The name identifying the new logger.
verbosity - The verbosity level.

Logger

public Logger(java.lang.String id,
              int verbosity,
              java.lang.String timeFormat,
              java.lang.String logFormat)
Create a logger object with a custom log format.

Parameters:
id - The name identifying the new logger.
verbosity - The verbosity level.
timeFormat - The format for log timestamps.
logFormat - The format for log messages.
Method Detail

println

public static void println()
Print a new line on the log stream.


println

public static void println(java.lang.String s)
Print a String in a device dependent way.


log

public void log(java.lang.String msg,
                int level)
Log a given message if the level is <= than the verbosity level of this Logger object.


setLogFormat

public void setLogFormat(java.lang.String format)
Define the log format of this Logger object.


setTimeFormat

public void setTimeFormat(java.lang.String format)
Establish a time format for this logger.

Parameters:
format - A string detailing the desired format for log messages.


JADE