Class Logging

java.lang.Object
nl.uu.cs.aplib.Logging

public class Logging extends Object
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 Details

  • Constructor Details

    • Logging

      Logging()
  • Method Details

    • getAPLIBlogger

      public static Logger getAPLIBlogger()
      Get the logger instance used by aplib.
    • addSystemErrAsLogHandler

      public static void addSystemErrAsLogHandler()
      Attach System.err to listen to this agent's logger (also called log-handler).
    • clearLoggers

      public static void clearLoggers()
      Remove all current handlers of the aplib logger.
    • attachFileAsLogHandler

      public static void attachFileAsLogHandler(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). The filename can include a path to the file.
    • setLoggingLevel

      public static void setLoggingLevel(Level level)
      To set the the logging level of aplib logger. Logging messages of lower level will then be ignored.