org.openbandy.service
Class LogService

java.lang.Object
  extended by org.openbandy.service.Service
      extended by org.openbandy.service.LogService

public final class LogService
extends Service

This is a helper class to simplify (and abstract) the usage of logging methods as logging functionality by providing static methods.

(c) Copyright P. Bolliger 2007, ALL RIGHTS RESERVED.

Version:
1.5
Author:
Philipp Bolliger (philipp@bolliger.name)

Constructor Summary
LogService()
           
 
Method Summary
static void debug(java.lang.Object originName, java.lang.String msg)
          Forwards a message with log level LEVEL_DEBUG to the log service
static void debug(java.lang.String originName, java.lang.String msg)
          Forwards a message with log level LEVEL_DEBUG to the log service
static void error(java.lang.Object originName, java.lang.String msg, java.lang.Throwable exception)
          Forwards a message with log level LEVEL_ERROR to the log service
static void error(java.lang.String originName, java.lang.String msg, java.lang.Throwable exception)
          Forwards a message with log level LEVEL_ERROR to the log service
static LogImpl getLog()
          Returns a reference to the actual log if this is an instance of type org.openbandy.log.LogImpl.
static void info(java.lang.Object originName, java.lang.String msg)
          Forwards a message with log level LEVEL_INFO to the log service
static void info(java.lang.String originName, java.lang.String msg)
          Forwards a message with log level LEVEL_INFO to the log service
static void setLog(Log log)
           
static void setLogLevel(int level)
          Set the log level.
static void warn(java.lang.Object originName, java.lang.String msg)
          Forwards a message with log level LEVEL_WARNING to the log service
static void warn(java.lang.String originName, java.lang.String msg)
          Forwards a message with log level LEVEL_WARNING to the log service
 
Methods inherited from class org.openbandy.service.Service
runningOnMicroEdition, runningOnSunWTK
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogService

public LogService()
Method Detail

getLog

public static LogImpl getLog()
Returns a reference to the actual log if this is an instance of type org.openbandy.log.LogImpl.

Returns:
Reference to the current log if it is a MicroeditionLog, null else

setLog

public static void setLog(Log log)

error

public static void error(java.lang.Object originName,
                         java.lang.String msg,
                         java.lang.Throwable exception)
Forwards a message with log level LEVEL_ERROR to the log service

Parameters:
originName - The object reporting
msg - The message to log
exception - The exception that was caused with this error

error

public static void error(java.lang.String originName,
                         java.lang.String msg,
                         java.lang.Throwable exception)
Forwards a message with log level LEVEL_ERROR to the log service

Parameters:
originName - The reporting object's class name
msg - The message to log
exception - The exception that was caused with this error

warn

public static void warn(java.lang.Object originName,
                        java.lang.String msg)
Forwards a message with log level LEVEL_WARNING to the log service

Parameters:
originName - The object reporting
msg - The message to log

warn

public static void warn(java.lang.String originName,
                        java.lang.String msg)
Forwards a message with log level LEVEL_WARNING to the log service

Parameters:
originName - The name of the object reporting
msg - The message to log

info

public static void info(java.lang.Object originName,
                        java.lang.String msg)
Forwards a message with log level LEVEL_INFO to the log service

Parameters:
originName - The object reporting
msg - The message to log

info

public static void info(java.lang.String originName,
                        java.lang.String msg)
Forwards a message with log level LEVEL_INFO to the log service

Parameters:
originName - The name of the object reporting
msg - The message to log

debug

public static void debug(java.lang.Object originName,
                         java.lang.String msg)
Forwards a message with log level LEVEL_DEBUG to the log service

Parameters:
originName - The object reporting
msg - The message to log

debug

public static void debug(java.lang.String originName,
                         java.lang.String msg)
Forwards a message with log level LEVEL_DEBUG to the log service

Parameters:
originName - The name of the object reporting
msg - The message to log

setLogLevel

public static void setLogLevel(int level)
Set the log level.

Parameters:
level - Log level according to