Package org.jorigin.logging
Class LogHandler
- java.lang.Object
-
- java.util.logging.Handler
-
- java.util.logging.StreamHandler
-
- org.jorigin.logging.LogHandler
-
public class LogHandler extends java.util.logging.StreamHandlerThis class is a convenience rewriting ofConsoleHandlerclass. Its provide a more flexible management of logging.- Since:
- 1.0.0
- Version:
- "1.0.8" - b201801141330L
- Author:
- Julien Seinturier - COMEX S.A. - contact@jorigin.org - https://github.com/jorigin/jeometry
-
-
Constructor Summary
Constructors Constructor Description LogHandler()Create a Log Handler forSystem.out.LogHandler(java.io.OutputStream output)Create a Log Handler that publish its records to the givenoutputLogHandler(java.io.OutputStream output, java.util.logging.Level level)Create a Log Handler that publish its records to the givenoutput.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()OverrideStreamHandler.close()to do a flush but not to close the output stream.voidpublish(java.util.logging.LogRecord record)Publish alog record.
The logging request was made initially to a Logger object, which initialized thelog recordand forwarded it here.-
Methods inherited from class java.util.logging.StreamHandler
flush, isLoggable, setEncoding, setOutputStream
-
-
-
-
Constructor Detail
-
LogHandler
public LogHandler()
Create a Log Handler forSystem.out.
-
LogHandler
public LogHandler(java.io.OutputStream output)
Create a Log Handler that publish its records to the givenoutput- Parameters:
output- the output stream where the records capted by this handler are published.
-
LogHandler
public LogHandler(java.io.OutputStream output, java.util.logging.Level level)Create a Log Handler that publish its records to the givenoutput. The record level is given by parameterlevel- Parameters:
output- the output stream where the records capted by this handler are published.level- the level of the publihed records.
-
-
Method Detail
-
publish
public void publish(java.util.logging.LogRecord record)
Publish alog record.
The logging request was made initially to a Logger object, which initialized thelog recordand forwarded it here.- Overrides:
publishin classjava.util.logging.StreamHandler- Parameters:
record- description of the log event. A null record is silently ignored and is not published
-
close
public void close()
OverrideStreamHandler.close()to do a flush but not to close the output stream. That is, we do not closeSystem.err.- Overrides:
closein classjava.util.logging.StreamHandler
-
-