Package nl.uu.cs.aplib
Class Logging
java.lang.Object
nl.uu.cs.aplib.Logging
Define aplib logging. Use
getAPLIBlogger() to get aplib's logger.
This is a single logger accessible from anywhere. Use
setLoggingLevel(Level) to globally set the logging level of this
logger. Use e.g. addSystemErrAsLogHandler() or
attachFileAsLogHandler(String) to attach listeners to this logger.
Messages sent to the logger will be echoed to its listerners.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidAttachSystem.errto listen to this agent's logger (also called log-handler).static voidattachFileAsLogHandler(String filename)Attach a file specified by the filename to receive messages sent to aplib's logger (in Logging jargon, the file becomes a log handler).static voidRemove all current handlers of the aplib logger.static LoggerGet the logger instance used by aplib.static voidsetLoggingLevel(Level level)To set the the logging level of aplib logger.
-
Field Details
-
APLIBLOGGER
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Logging
Logging()
-
-
Method Details
-
getAPLIBlogger
Get the logger instance used by aplib. -
addSystemErrAsLogHandler
public static void addSystemErrAsLogHandler()AttachSystem.errto listen to this agent's logger (also called log-handler). -
clearLoggers
public static void clearLoggers()Remove all current handlers of the aplib logger. -
attachFileAsLogHandler
Attach a file specified by the filename to receive messages sent to aplib's logger (in Logging jargon, the file becomes a log handler). The filename can include a path to the file. -
setLoggingLevel
To set the the logging level of aplib logger. Logging messages of lower level will then be ignored.
-