|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.GenericService SK.gnome.dwarf.thread.ThreadService SK.gnome.dwarf.log.GenericLogger SK.gnome.dwarf.log.StreamLogger SK.gnome.dwarf.log.SystemLogger
The system console logger. It can be used to log the messages to the standard system console.
Field Summary |
Fields inherited from class SK.gnome.dwarf.log.StreamLogger |
dateTime, dateTimeFormat, extendedInfo, out |
Fields inherited from class SK.gnome.dwarf.log.GenericLogger |
facilities, levels, lock, LOG_FACILITY_ALL |
Fields inherited from class SK.gnome.dwarf.thread.ThreadService |
daemon, thread |
Fields inherited from class SK.gnome.dwarf.GenericService |
initParameters, parent |
Fields inherited from interface SK.gnome.dwarf.Service |
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED |
Constructor Summary | |
SystemLogger(java.lang.String name)
Creates a new SystemLogger. |
Method Summary | |
static void |
enableLogging()
Enables the logging only if it is disabled. |
void |
init(Server parent)
Inititalizes the service and sets the output stream. |
static void |
setLogging(boolean enable)
Enables or disables the logging. |
protected boolean |
wouldLog(java.lang.String facility,
LogLevel level)
Decides whether the logger would log a message with the given loggging level and facility. |
protected void |
write(long time,
java.lang.String facility,
LogLevel level,
java.lang.String message,
java.lang.Throwable error)
Writes the message to the output stream. |
Methods inherited from class SK.gnome.dwarf.log.StreamLogger |
setDateTime, setDateTimeFormat, setDateTimeFormat, setExtendedInfo |
Methods inherited from class SK.gnome.dwarf.log.GenericLogger |
enableThread, getLastAccessed, log, log, loop, setFacilities, setLevels, setMarkInterval, setRepeatedInterval, shutdown, start |
Methods inherited from class SK.gnome.dwarf.thread.ThreadService |
finish, run, setDaemon, stop |
Methods inherited from class SK.gnome.dwarf.GenericService |
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SystemLogger(java.lang.String name)
Method Detail |
public static void setLogging(boolean enable)
If set to false, all instances of this class are muted until the operation is enabled again.
If a security manager is installed, the ServicePermission "setLogging" is checked first.
enable
- true to enable loggingpublic static void enableLogging()
Calls setLogging(boolean)
with true only if the logging is currently
disabled.
public void init(Server parent) throws ServiceException
The stream is set to the actual value of the System.out field.
init
in interface Service
init
in class GenericService
ServiceException
protected boolean wouldLog(java.lang.String facility, LogLevel level)
StreamLogger
It first checks whether the output stream has been initialized and then calls the overriden wouldLog method and returns its result.
wouldLog
in class StreamLogger
protected void write(long time, java.lang.String facility, LogLevel level, java.lang.String message, java.lang.Throwable error)
StreamLogger
The time argument will be formatted according to the StreamLogger.dateTimeFormat
field value if writting of the date and time information is enabled via the
StreamLogger.setDateTime(boolean)
method.
write
in class StreamLogger
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |