Class SplitLogger

java.lang.Object
org.jlab.logging.SplitLogger

public class SplitLogger extends Object
Helper methods to create a Logger that sends errors to stderr and everything else to stdout
Author:
dilks
See Also:
  • Constructor Details

    • SplitLogger

      public SplitLogger()
  • Method Details

    • create

      public static Logger create(String name)
      create a new SplitLogger instance, with formatted messages
      Parameters:
      name - the name of the logger
      Returns:
      a new SplitLogger instance
    • create

      public static Logger create(String name, boolean includePrefix)
      create a new SplitLogger instance, with an optional message formatting including a prefix
      Parameters:
      name - the name of the logger
      includePrefix - whether or not to include a prefix in the formatting
      Returns:
      a new SplitLogger instance
    • 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