SK.gnome.dwarf.log
Class NullLogger

java.lang.Object
  extended bySK.gnome.dwarf.GenericService
      extended bySK.gnome.dwarf.thread.ThreadService
          extended bySK.gnome.dwarf.log.GenericLogger
              extended bySK.gnome.dwarf.log.NullLogger
All Implemented Interfaces:
Logger, java.lang.Runnable, Service

public class NullLogger
extends GenericLogger

The null logger.

This logger simply discards all log messages.


Field Summary
 
Fields inherited from class SK.gnome.dwarf.log.GenericLogger
facilities, levels, lock, LOG_FACILITY_ALL
 
Fields inherited from class SK.gnome.dwarf.thread.ThreadService
daemon, thread
 
Fields inherited from class SK.gnome.dwarf.GenericService
initParameters, parent
 
Fields inherited from interface SK.gnome.dwarf.Service
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED
 
Constructor Summary
NullLogger(java.lang.String name)
          Creates a new NullLogger.
 
Method Summary
protected  boolean wouldLog(java.lang.String facility, LogLevel level)
          Decides whether the message would be accepted by the logger.
protected  void write(long time, java.lang.String facility, LogLevel level, java.lang.String message, java.lang.Throwable throwable)
          Writes the message to a physical device.
 
Methods inherited from class SK.gnome.dwarf.log.GenericLogger
enableThread, getLastAccessed, log, log, loop, setFacilities, setLevels, setMarkInterval, setRepeatedInterval, shutdown, start
 
Methods inherited from class SK.gnome.dwarf.thread.ThreadService
finish, run, setDaemon, stop
 
Methods inherited from class SK.gnome.dwarf.GenericService
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, init, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NullLogger

public NullLogger(java.lang.String name)
Creates a new NullLogger.

Method Detail

wouldLog

protected boolean wouldLog(java.lang.String facility,
                           LogLevel level)
Decides whether the message would be accepted by the logger.

Returns always false therefore all messages are discarded by default.

Overrides:
wouldLog in class GenericLogger
Parameters:
facility - the logging facility
level - the logging level
Returns:
always false

write

protected void write(long time,
                     java.lang.String facility,
                     LogLevel level,
                     java.lang.String message,
                     java.lang.Throwable throwable)
Writes the message to a physical device.

This method actually does nothing.

Specified by:
write in class GenericLogger
Parameters:
time - the current time of the logged event
facility - the log facility
level - the log level
message - the message
throwable - the error (optional)
See Also:
GenericLogger.log(String, LogLevel, String), GenericLogger.log(String, LogLevel, String, Throwable)


Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.