|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttuwien.auto.calimero.log.LogManager
public final class LogManager
Global Manager for LogService
s and LogWriter
s.
There is only one instance of this manager in the library, obtained with
getManager()
.
A log service can be queried and removed. A log writer can be added (i.e. registered)
and removed, either to a particular log service or as a global log writer. A global log
writer will receive all logging output from all registered log services.
LogWriter
,
LogService
Method Summary | |
---|---|
boolean |
addWriter(java.lang.String logService,
LogWriter writer)
Adds a log writer, either global or to a particular log service. |
LogWriter[] |
getAllGlobalWriter()
Returns all registered global log writer. |
java.lang.String[] |
getAllLogServices()
Returns the names of all registered log services. |
LogService |
getLogService(java.lang.String name)
Queries for a log service with the specified name . |
static LogManager |
getManager()
Returns the only instance of the log manager. |
boolean |
hasLogService(java.lang.String name)
Checks whether a log service with name exists in the manager. |
void |
removeLogService(java.lang.String name)
Removes a log service from the manager. |
void |
removeWriter(java.lang.String logService,
LogWriter writer)
Removes a log writer, either global or from a particular logService . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean addWriter(java.lang.String logService, LogWriter writer)
Note that the writer is added to the log service(s) regardless if it was already
added before.
If the writer is added global, it will receive logging information from all log
services that are already registered or will be registered in the future.
logService
- name of a log service; to add the writer global, use an empty
string or null
writer
- log writer to add
LogService.addWriter(LogWriter)
public LogWriter[] getAllGlobalWriter()
Global are all log writers which were not registered at a particular log service.
public java.lang.String[] getAllLogServices()
public LogService getLogService(java.lang.String name)
name
.
If the log service with this name already exists in the manager, it will be returned, otherwise a new log service with this name will be created and added to the log services listed in the manager.
name
- name of log service, the empty string is not allowed
public static LogManager getManager()
public boolean hasLogService(java.lang.String name)
name
exists in the manager.
A log service is only listed in the manager, if it was initially queried using
getLogService(String)
.
name
- name of log service
true
if log service exists, false
otherwisepublic void removeLogService(java.lang.String name)
If no log service with the specified name is found, no action is performed.
name
- name of log servicepublic void removeWriter(java.lang.String logService, LogWriter writer)
logService
.
Note that for a writer to be removed global, it had to be added global before.
logService
- name of the log service of which the writer will be removed; to
remove the writer global, use an empty string or null
writer
- log writer to removeLogService.removeWriter(LogWriter)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |