Package loci.common

Class LogbackTools

java.lang.Object
loci.common.LogbackTools

public final class LogbackTools extends Object
A utility class with convenience methods for logback.
  • Method Details

    • isEnabled

      public static boolean isEnabled()
      Checks whether logback has been enabled. This method will check if the root logger has been initialized via either a configuration file or a previous call to enableLogging(). The logger context property will be used to discriminate the latter case from other initializations.
      Returns:
      true if logging was successfully enabled
    • setRootLevel

      public static void setRootLevel(String level)
      Sets the level of the root logger
      Parameters:
      level - A string indicating the desired level (i.e.: ALL, DEBUG, ERROR, FATAL, INFO, OFF, WARN).
    • enableLogging

      public static boolean enableLogging()
      Initializes logback without an external configuration file. The logging initialization also sets a logger context property to record the initalization provenance.
      Returns:
      true if logging was successfully enabled
    • enableIJLogging

      public static void enableIJLogging(boolean debug, ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent> appender)