cz.cuni.amis.pogamut.base.utils.logging
Class LogHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by cz.cuni.amis.pogamut.base.utils.logging.LogHandler
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
LogHandler.ConsoleLogHandler

public class LogHandler
extends java.util.logging.Handler
implements java.lang.Cloneable

Handler for the messages - instantiated without publisher.

Use setPublisher() or constructor with ILogPublisher parameter.

See LogPublisher and it's public static inner classes ConsolePublisher and FilePublisher.


Nested Class Summary
static class LogHandler.ConsoleLogHandler
           
 
Field Summary
protected  ILogPublisher publisher
           
 
Constructor Summary
LogHandler()
          Creates empty log handler without any publisher.
LogHandler(ILogPublisher publisher)
          Creates log handler with specific publisher.
 
Method Summary
 void close()
           
 boolean equals(java.lang.Object obj)
           
 void flush()
           
 ILogPublisher getPublisher()
          Returns actual publisher of the hanlder.
 int hashCode()
           
 void publish(java.util.logging.LogRecord record)
           
 void setPublisher(ILogPublisher publisher)
          Sets new publisher to the handler.
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

publisher

protected ILogPublisher publisher
Constructor Detail

LogHandler

public LogHandler()
Creates empty log handler without any publisher.


LogHandler

public LogHandler(ILogPublisher publisher)
Creates log handler with specific publisher.

Parameters:
publisher -
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getPublisher

public ILogPublisher getPublisher()
Returns actual publisher of the hanlder.

Returns:

setPublisher

public void setPublisher(ILogPublisher publisher)
Sets new publisher to the handler.

Parameters:
publisher -

close

public void close()
           throws java.lang.SecurityException
Specified by:
close in class java.util.logging.Handler
Throws:
java.lang.SecurityException

flush

public void flush()
Specified by:
flush in class java.util.logging.Handler

publish

public void publish(java.util.logging.LogRecord record)
Specified by:
publish in class java.util.logging.Handler