Package ch.raffael.meldioc.logging
Class Logging
java.lang.Object
ch.raffael.meldioc.logging.Logging
An front-end to SLF4J's
LoggerFactory. It adds:
- checks to current logger backend configuration (specifically if JUL is redirected correctly)
- handles inner and anonymous classes correctly (use canonical name)
- provides a parameterless factory method that uses the
StackWalkerintroduced in Java 9 to determine the logger name
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidinit()Does nothing as logging will be initialized whenever this class is loaded.static org.slf4j.Loggerlogger()Create a new logger for the caller class as oflogger(Class).static org.slf4j.LoggerCreates a new logger for the given class.static org.slf4j.Loggerstatic voidshutdown()
-
Method Details
-
init
public static void init()Does nothing as logging will be initialized whenever this class is loaded. It is strongly recommended to call this first in your main method to ensure just that. -
shutdown
public static void shutdown() -
logger
public static org.slf4j.Logger logger()Create a new logger for the caller class as oflogger(Class). -
logger
Creates a new logger for the given class. If the caller class is an anonymous or local inner class, this method searches the innermost enclosing non-anonymous class. If the class is an array, the component type will be used. -
logger
-