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 Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidenableIJLogging(boolean debug, ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent> appender)static booleanenableLogging()Initializes logback without an external configuration file.static booleanisEnabled()Checks whether logback has been enabled.static voidsetRootLevel(String level)Sets the level of the root logger
-
-
-
Method Detail
-
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
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:
trueif logging was successfully enabled
-
enableIJLogging
public static void enableIJLogging(boolean debug, ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent> appender)
-
-