public abstract class LogPublisher extends Object implements ILogPublisher
As default SimpleFormatter from the java.logging API is used.
Contains two default implementations ConsolePublisher and FilePublisher.
| Modifier and Type | Class and Description |
|---|---|
static class |
LogPublisher.ConsolePublisher |
static class |
LogPublisher.FilePublisher |
| Constructor and Description |
|---|
LogPublisher() |
LogPublisher(Formatter formatter) |
LogPublisher(IAgentId name) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
close()
From JavaDoc API:
|
abstract void |
flush()
From JavaDoc API:
|
Formatter |
getFormatter() |
void |
publish(LogRecord record)
From JavaDoc API:
|
abstract void |
publish(LogRecord record,
String formattedMsg) |
void |
setFormatter(Formatter formatter) |
protected Formatter formatter
public LogPublisher()
public LogPublisher(IAgentId name)
public LogPublisher(Formatter formatter)
public Formatter getFormatter()
public void setFormatter(Formatter formatter)
public abstract void close()
throws SecurityException
ILogPublisherClose the Handler and free all associated resources.
The close method will perform a flush and then close the Handler. After close has been called this Handler should no longer be used. Method calls may either be silently ignored or may throw runtime exceptions.
close in interface ILogPublisherSecurityException - if a security manager exists and if
the caller does not have LoggingPermission("control").public abstract void flush()
ILogPublisherFlush any buffered output.
flush in interface ILogPublisherpublic void publish(LogRecord record)
ILogPublisherPublish a LogRecord.
The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here.
The Handler is responsible for formatting the message, when and if necessary. The formatting should include localization.
publish in interface ILogPublisherrecord - description of the log event. A null record is
silently ignored and is not publishedCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.