br.ufsc.tlm.j2me.logging
Class Logger

java.lang.Object
  extended bybr.ufsc.tlm.j2me.logging.Logger

public class Logger
extends java.lang.Object

Created on Aug 26, 2003

Author:
Eric Giguere Implemented by Thiago Lećo Moreira from the article "A Simple MIDP Logging Facility" avaiable in http://wireless.java.sun.com/midp/ttips/logging/

Method Summary
 void clearLog()
          Call to clear the log, which must be closed.
static void closeLog()
          Call to close the log.
 void fine(java.lang.String msg)
          Log a message with the FINE level.
 Level getLevel()
          Get this logger's level, which may be null.
static Logger getLogger(java.lang.String name)
          Find the logger registered with a specific name.
 java.lang.String getName()
          Return the logger's name.
 Logger getParent()
          Return the logger's parent.
 void info(java.lang.String msg)
          Log a message with the INFO level.
 boolean isLoggable(Level test)
          Test whether the given level is loggable according to this Logger.
 void log(Level level, java.lang.String msg)
          Log a message using the given level.
 void log(Level level, java.lang.String msg, java.lang.Throwable e)
          Log a message using the given level including optional exception information.
 void setLevel(Level level)
          Sets the logger's level.
static void setLogToRS(boolean log)
          Whether or not to log to the record store.
static void setLogToStdout(boolean log)
          Whether or not to log to System.out.
 void setParent(Logger parent)
          Sets the logger's parent.
 void severe(java.lang.String msg)
          Log a message with the SEVERE level.
 void warning(java.lang.String msg)
          Log a message with the WARNING level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

closeLog

public static void closeLog()
Call to close the log.


getLogger

public static Logger getLogger(java.lang.String name)
Find the logger registered with a specific name.


setLogToRS

public static void setLogToRS(boolean log)
Whether or not to log to the record store.


setLogToStdout

public static void setLogToStdout(boolean log)
Whether or not to log to System.out.


clearLog

public void clearLog()
              throws javax.microedition.rms.RecordStoreException
Call to clear the log, which must be closed.

Throws:
javax.microedition.rms.RecordStoreException

fine

public void fine(java.lang.String msg)
Log a message with the FINE level.


getLevel

public Level getLevel()
Get this logger's level, which may be null.


getName

public java.lang.String getName()
Return the logger's name.


getParent

public Logger getParent()
Return the logger's parent. The parent is reset if other loggers were created, in case children are created after their parents.


info

public void info(java.lang.String msg)
Log a message with the INFO level.


isLoggable

public boolean isLoggable(Level test)
Test whether the given level is loggable according to this Logger.


log

public void log(Level level,
                java.lang.String msg)
Log a message using the given level.


log

public void log(Level level,
                java.lang.String msg,
                java.lang.Throwable e)
Log a message using the given level including optional exception information.


setLevel

public void setLevel(Level level)
Sets the logger's level. May be null.


setParent

public void setParent(Logger parent)
Sets the logger's parent.


severe

public void severe(java.lang.String msg)
Log a message with the SEVERE level.


warning

public void warning(java.lang.String msg)
Log a message with the WARNING level.



Copyright © 2003 Federal University of Santa Catarina. All Rights Reserved.