Package loci.common
Class LogbackTools
java.lang.Object
loci.common.LogbackTools
A utility class with convenience methods for logback.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidenableIJLogging(boolean debug, ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent> appender) static booleanInitializes logback without an external configuration file.static booleanChecks whether logback has been enabled.static voidsetRootLevel(String level) Sets the level of the root logger
-
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 toenableLogging(). The logger context property will be used to discriminate the latter case from other initializations.- Returns:
trueif logging was successfully enabled
-
setRootLevel
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:
trueif logging was successfully enabled
-
enableIJLogging
public static void enableIJLogging(boolean debug, ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent> appender)
-