Package loci.common

Class LogbackTools

java.lang.Object
loci.common.LogbackTools

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

    Modifier and Type Method Description
    static void enableIJLogging​(boolean debug, ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent> appender)  
    static boolean enableLogging()
    Initializes logback without an external configuration file.
    static boolean isEnabled()
    Checks whether logback has been enabled.
    static void setRootLevel​(java.lang.String level)
    Sets the level of the root logger

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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​(java.lang.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)