org.xulux.api.logging
Interface ILogger


public interface ILogger

The ILogger interface. It serves as the interface for xulux logger wrapper implementations.

Version:
$Id: ILogger.java,v 1.1 2005/12/18 12:58:17 mvdb Exp $
Author:
Martin van den Bemt

Method Summary
 void clearCache()
          Clears the logging cache
 ILog getCurrentLogger()
           
 ILog getDefaultLogger()
           
 int getLevel()
           
 ILog getLogger(java.lang.String name)
           
 boolean isLevel(int level)
           
 void log(int level, java.lang.String name, java.lang.String message)
          Log a message
 void log(int level, java.lang.String name, java.lang.String message, java.lang.Throwable t)
          Log a message
 void registerLogger(java.lang.String name, java.lang.String clz)
          Register a logger.
 void setCurrentLogger(java.lang.String name)
          Sets the current logger.
 void setDefaultLogger(java.lang.String name)
          Set the default logger
 void setLevel(int level)
          If the level is null, it will start using the default log level again.
 void useDefaultLogger()
          Start using the default logger
 

Method Detail

getLevel

int getLevel()
Returns:
the log level used. If not set, it will return DEFAULTLEVEL

isLevel

boolean isLevel(int level)
Parameters:
level - the level to check
Returns:
if the current level of logging falls within the level specified

setLevel

void setLevel(int level)
If the level is null, it will start using the default log level again.

Parameters:
level - the log level

log

void log(int level,
         java.lang.String name,
         java.lang.String message)
Log a message

Parameters:
level - the level to use
name - the name to use (used as eg a prefix in the logging output)
message - the log message

log

void log(int level,
         java.lang.String name,
         java.lang.String message,
         java.lang.Throwable t)
Log a message

Parameters:
level - the level to use
name - the name to use (used as eg a prefix in the logging output)
message - the log message
t - the exception to log

getCurrentLogger

ILog getCurrentLogger()
Returns:
the currently used logger instance

setDefaultLogger

void setDefaultLogger(java.lang.String name)
Set the default logger

Parameters:
name - the name of the logger

getLogger

ILog getLogger(java.lang.String name)
Parameters:
name - the name of the logger
Returns:
the log instance or null if it doesn't exist.

getDefaultLogger

ILog getDefaultLogger()
Returns:
the default log

setCurrentLogger

void setCurrentLogger(java.lang.String name)
Sets the current logger.

Parameters:
name - the name of the logger

clearCache

void clearCache()
Clears the logging cache


useDefaultLogger

void useDefaultLogger()
Start using the default logger


registerLogger

void registerLogger(java.lang.String name,
                    java.lang.String clz)
Register a logger.

Parameters:
name - the name of the logger
clz - the class of the logger interface.


Copyright © 2002-2007 Martin van den Bemt. All Rights Reserved.