org.arakhne.logging
Class AbstractPrintStreamLogger

java.lang.Object
  extended by org.arakhne.logging.AbstractLogger
      extended by org.arakhne.logging.AbstractStandAloneLogger
          extended by org.arakhne.logging.AbstractPrintStreamLogger
All Implemented Interfaces:
Logger
Direct Known Subclasses:
ConsoleLogger, FileLogger

public abstract class AbstractPrintStreamLogger
extends AbstractStandAloneLogger

This class provides the base for a concrete implementation of the Logger interface. This logger impl contains the minimal knowledge required to implement loggers which are writing inside a print stream.

Version:
1.7 (rev:285) 2011-10-14 12:02:59
Author:
Stéphane GALLAND
See Also:
Logger
Maven Group Id:
org.arakhne.afc
Maven Artifact Id:
arakhneLogger

Field Summary
protected  PrintStream anomalyStream
          Output print stream for anomalies.
protected  PrintStream noticeStream
          Output print stream for messages.
 
Fields inherited from class org.arakhne.logging.AbstractStandAloneLogger
name
 
Constructor Summary
AbstractPrintStreamLogger(PrintStream anomalyStream, PrintStream noticeStream)
          Unamed Logger on system console.
AbstractPrintStreamLogger(PrintStream anomalyStream, PrintStream noticeStream, String name)
          Named Logger on system console.
 
Method Summary
 void log(Object source, LogLevel level, String msg, Throwable exception)
          
 
Methods inherited from class org.arakhne.logging.AbstractStandAloneLogger
getLocalizedString, getName
 
Methods inherited from class org.arakhne.logging.AbstractLogger
addLoggerEventListener, debug, debug, error, error, fireLoggerEvent, fireLoggerEvent, getLogLevel, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isLoggableFor, isWarnEnabled, log, removeLoggerEventListener, setLogLevel, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

anomalyStream

protected final PrintStream anomalyStream
Output print stream for anomalies.


noticeStream

protected final PrintStream noticeStream
Output print stream for messages.

Constructor Detail

AbstractPrintStreamLogger

public AbstractPrintStreamLogger(PrintStream anomalyStream,
                                 PrintStream noticeStream)
Unamed Logger on system console.

Parameters:
anomalyStream - is the output stream inside which anomaly logs will be put.
noticeStream - is the output stream inside which notice logs will be put.

AbstractPrintStreamLogger

public AbstractPrintStreamLogger(PrintStream anomalyStream,
                                 PrintStream noticeStream,
                                 String name)
Named Logger on system console.

Parameters:
anomalyStream - is the output stream inside which anomaly logs will be put.
noticeStream - is the output stream inside which notice logs will be put.
name - is the name of the logger.
Method Detail

log

public void log(Object source,
                LogLevel level,
                String msg,
                Throwable exception)

Parameters:
source - - the object which send this log
level - - the log level
msg - - the message to log
exception - - the exception cause of the log message


Copyright © 2006-2011 Arakhnê.org Consortium. All rights reserved under LGPL license terms.