Class Logging

java.lang.Object
ch.raffael.meldioc.logging.Logging

public class Logging extends Object
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 StackWalker introduced in Java 9 to determine the logger name
  • 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 of logger(Class).
    • logger

      public static org.slf4j.Logger logger(Class<?> type)
      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

      public static org.slf4j.Logger logger(String name)