Class JooqLogger

  • All Implemented Interfaces:
    Log

    public final class JooqLogger
    extends java.lang.Object
    implements Log
    The jOOQ logger abstraction.

    This logger provides abstraction over the three logger APIs supported optionally by jOOQ. These are (in order of preference):

    • slf4j
    • log4j
    • jav.util.logging
    JooqLogger tries to instantiate any of the above loggers, catching potential NoClassDefFoundError's in case any logger API cannot be found on the classpath.
    Author:
    Lukas Eder
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  JooqLogger.Level
      Deprecated.
      - Use Log.Level instead
    • Constructor Summary

      Constructors 
      Constructor Description
      JooqLogger()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void debug​(java.lang.Object message)
      Log a message in DEBUG level.
      void debug​(java.lang.Object message, java.lang.Object details)
      Log a message in DEBUG level.
      void debug​(java.lang.Object message, java.lang.Object details, java.lang.Throwable throwable)
      Log a message in DEBUG level.
      void debug​(java.lang.Object message, java.lang.Throwable throwable)
      Log a message in DEBUG level.
      void error​(java.lang.Object message)
      Log a message in ERROR level.
      void error​(java.lang.Object message, java.lang.Object details)
      Log a message in ERROR level.
      void error​(java.lang.Object message, java.lang.Object details, java.lang.Throwable throwable)
      Log a message in ERROR level.
      void error​(java.lang.Object message, java.lang.Throwable throwable)
      Log a message in ERROR level.
      static JooqLogger getLogger​(java.lang.Class<?> clazz)
      Get a logger wrapper for a class.
      static void globalThreshold​(Log.Level level)
      Set a global level threshold to all JooqLoggers.
      static void globalThreshold​(JooqLogger.Level level)
      Set a global level threshold to all JooqLoggers.
      void info​(java.lang.Object message)
      Log a message in INFO level.
      void info​(java.lang.Object message, java.lang.Object details)
      Log a message in INFO level.
      void info​(java.lang.Object message, java.lang.Object details, java.lang.Throwable throwable)
      Log a message in INFO level.
      void info​(java.lang.Object message, java.lang.Throwable throwable)
      Log a message in INFO level.
      boolean isDebugEnabled()
      Check if DEBUG level logging is enabled.
      boolean isInfoEnabled()
      Check if INFO level logging is enabled.
      boolean isTraceEnabled()
      Check if TRACE level logging is enabled.
      void trace​(java.lang.Object message)
      Log a message in TRACE level.
      void trace​(java.lang.Object message, java.lang.Object details)
      Log a message in TRACE level.
      void trace​(java.lang.Object message, java.lang.Object details, java.lang.Throwable throwable)
      Log a message in TRACE level.
      void trace​(java.lang.Object message, java.lang.Throwable throwable)
      Log a message in TRACE level.
      void warn​(java.lang.Object message)
      Log a message in WARN level.
      void warn​(java.lang.Object message, java.lang.Object details)
      Log a message in WARN level.
      void warn​(java.lang.Object message, java.lang.Object details, java.lang.Throwable throwable)
      Log a message in WARN level.
      void warn​(java.lang.Object message, java.lang.Throwable throwable)
      Log a message in WARN level.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JooqLogger

        public JooqLogger()
    • Method Detail

      • getLogger

        public static JooqLogger getLogger​(java.lang.Class<?> clazz)
        Get a logger wrapper for a class.
      • isTraceEnabled

        public boolean isTraceEnabled()
        Check if TRACE level logging is enabled.
        Specified by:
        isTraceEnabled in interface Log
      • trace

        public void trace​(java.lang.Object message)
        Log a message in TRACE level.
        Specified by:
        trace in interface Log
        Parameters:
        message - The log message
      • trace

        public void trace​(java.lang.Object message,
                          java.lang.Object details)
        Log a message in TRACE level.
        Specified by:
        trace in interface Log
        Parameters:
        message - The log message
        details - The message details (padded to a constant-width message)
      • trace

        public void trace​(java.lang.Object message,
                          java.lang.Throwable throwable)
        Log a message in TRACE level.
        Specified by:
        trace in interface Log
        Parameters:
        message - The log message
        throwable - An exception whose stacktrace is logged along with the message
      • trace

        public void trace​(java.lang.Object message,
                          java.lang.Object details,
                          java.lang.Throwable throwable)
        Log a message in TRACE level.
        Specified by:
        trace in interface Log
        Parameters:
        message - The log message
        details - The message details (padded to a constant-width message)
        throwable - An exception whose stacktrace is logged along with the message
      • isDebugEnabled

        public boolean isDebugEnabled()
        Check if DEBUG level logging is enabled.
        Specified by:
        isDebugEnabled in interface Log
      • debug

        public void debug​(java.lang.Object message)
        Log a message in DEBUG level.
        Specified by:
        debug in interface Log
        Parameters:
        message - The log message
      • debug

        public void debug​(java.lang.Object message,
                          java.lang.Object details)
        Log a message in DEBUG level.
        Specified by:
        debug in interface Log
        Parameters:
        message - The log message
        details - The message details (padded to a constant-width message)
      • debug

        public void debug​(java.lang.Object message,
                          java.lang.Throwable throwable)
        Log a message in DEBUG level.
        Specified by:
        debug in interface Log
        Parameters:
        message - The log message
        throwable - An exception whose stacktrace is logged along with the message
      • debug

        public void debug​(java.lang.Object message,
                          java.lang.Object details,
                          java.lang.Throwable throwable)
        Log a message in DEBUG level.
        Specified by:
        debug in interface Log
        Parameters:
        message - The log message
        details - The message details (padded to a constant-width message)
        throwable - An exception whose stacktrace is logged along with the message
      • isInfoEnabled

        public boolean isInfoEnabled()
        Check if INFO level logging is enabled.
        Specified by:
        isInfoEnabled in interface Log
      • info

        public void info​(java.lang.Object message)
        Log a message in INFO level.
        Specified by:
        info in interface Log
        Parameters:
        message - The log message
      • info

        public void info​(java.lang.Object message,
                         java.lang.Object details)
        Log a message in INFO level.
        Specified by:
        info in interface Log
        Parameters:
        message - The log message
        details - The message details (padded to a constant-width message)
      • info

        public void info​(java.lang.Object message,
                         java.lang.Throwable throwable)
        Log a message in INFO level.
        Specified by:
        info in interface Log
        Parameters:
        message - The log message
        throwable - An exception whose stacktrace is logged along with the message
      • info

        public void info​(java.lang.Object message,
                         java.lang.Object details,
                         java.lang.Throwable throwable)
        Log a message in INFO level.
        Specified by:
        info in interface Log
        Parameters:
        message - The log message
        details - The message details (padded to a constant-width message)
        throwable - An exception whose stacktrace is logged along with the message
      • warn

        public void warn​(java.lang.Object message)
        Log a message in WARN level.
        Specified by:
        warn in interface Log
        Parameters:
        message - The log message
      • warn

        public void warn​(java.lang.Object message,
                         java.lang.Object details)
        Log a message in WARN level.
        Specified by:
        warn in interface Log
        Parameters:
        message - The log message
        details - The message details (padded to a constant-width message)
      • warn

        public void warn​(java.lang.Object message,
                         java.lang.Throwable throwable)
        Log a message in WARN level.
        Specified by:
        warn in interface Log
        Parameters:
        message - The log message
        throwable - An exception whose stacktrace is logged along with the message
      • warn

        public void warn​(java.lang.Object message,
                         java.lang.Object details,
                         java.lang.Throwable throwable)
        Log a message in WARN level.
        Specified by:
        warn in interface Log
        Parameters:
        message - The log message
        details - The message details (padded to a constant-width message)
        throwable - An exception whose stacktrace is logged along with the message
      • error

        public void error​(java.lang.Object message)
        Log a message in ERROR level.
        Specified by:
        error in interface Log
        Parameters:
        message - The log message
      • error

        public void error​(java.lang.Object message,
                          java.lang.Object details)
        Log a message in ERROR level.
        Specified by:
        error in interface Log
        Parameters:
        message - The log message
        details - The message details (padded to a constant-width message)
      • error

        public void error​(java.lang.Object message,
                          java.lang.Throwable throwable)
        Log a message in ERROR level.
        Specified by:
        error in interface Log
        Parameters:
        message - The log message
        throwable - An exception whose stacktrace is logged along with the message
      • error

        public void error​(java.lang.Object message,
                          java.lang.Object details,
                          java.lang.Throwable throwable)
        Log a message in ERROR level.
        Specified by:
        error in interface Log
        Parameters:
        message - The log message
        details - The message details (padded to a constant-width message)
        throwable - An exception whose stacktrace is logged along with the message
      • globalThreshold

        public static void globalThreshold​(JooqLogger.Level level)
        Set a global level threshold to all JooqLoggers.
      • globalThreshold

        public static void globalThreshold​(Log.Level level)
        Set a global level threshold to all JooqLoggers.