Class SplitLogManager

java.lang.Object
java.util.logging.LogManager
org.jlab.logging.SplitLogManager

public class SplitLogManager extends LogManager
LogManager that sends errors to stderr and everything else to stdout
Author:
dilks
  • Constructor Details

    • SplitLogManager

      public SplitLogManager()
  • Method Details

    • getLogger

      public Logger getLogger(String name)
      create a new Logger instance
      Overrides:
      getLogger in class LogManager
      Parameters:
      name - the name of the logger
      Returns:
      a new Logger instance
    • addLogger

      public boolean addLogger(Logger logger)
      add a new Logger instance
      Overrides:
      addLogger in class LogManager
      Parameters:
      name - the name of the logger
      Returns:
      true if the argument logger was registered successfully, false if a logger of that name already exists
    • configureHandlers

      public static void configureHandlers(Logger logger, boolean includePrefix)
      Configure a logger handlers such that errors go to stderr and everything else to stdout
      Parameters:
      logger - the Logger instance to configure
      includePrefix - whether or not to include a prefix in the formatting
    • configureLevel

      public static void configureLevel(Logger logger, Level level)
      set the log level of a logger and its handlers
      Parameters:
      logger - the Logger instance to configure
      level - the Level to apply