Class JdkLogger

java.lang.Object
com.clickhouse.logging.JdkLogger
All Implemented Interfaces:
Logger

public class JdkLogger extends Object implements Logger
Adaptor for JDK logger.
  • Field Summary

    Fields inherited from interface com.clickhouse.logging.Logger

    ERROR_NULL_LOGGER
  • Constructor Summary

    Constructors
    Constructor
    Description
    JdkLogger(Logger logger)
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    debug(Object format, Object... arguments)
    Logs a message at the DEBUG level according to the specified format and arguments.
    void
    debug(Object message, Throwable t)
    Logs an error (see Throwable) at the DEBUG level with an accompanying message.
    void
    debug(Supplier<?> function)
    Logs output of a custom function at the DEBUG level.
    void
    error(Object format, Object... arguments)
    Logs a message at the ERROR level according to the specified format and arguments.
    void
    error(Object message, Throwable t)
    Logs an error (see Throwable) at the ERROR level with an accompanying message.
    void
    error(Supplier<?> function)
    Logs output of a custom function at the ERROR level.
    void
    info(Object format, Object... arguments)
    Logs a message at the INFO level according to the specified format and arguments.
    void
    info(Object message, Throwable t)
    Logs an error (see Throwable) at the INFO level with an accompanying message.
    void
    info(Supplier<?> function)
    Logs output of a custom function at the INFO level.
    boolean
    Checks if logging level is DEBUG or above.
    boolean
    Checks if logging level is ERROR or above.
    boolean
    Checks if logging level is INFO or above.
    boolean
    Checks if logging level is TRACE or above.
    boolean
    Checks if logging level is WARN or above.
    protected void
    log(Level level, LogMessage msg)
     
    void
    trace(Object format, Object... arguments)
    Logs a message at the TRACE level according to the specified format and arguments.
    void
    trace(Object message, Throwable t)
    Logs an error (see Throwable) at the TRACE level with an accompanying message.
    void
    trace(Supplier<?> function)
    Logs output of a custom function at the TRACE level.
    Return logger implementation.
    void
    warn(Object format, Object... arguments)
    Logs a message at the WARN level according to the specified format and arguments.
    void
    warn(Object message, Throwable t)
    Logs an error (see Throwable) at the WRAN level with an accompanying message.
    void
    warn(Supplier<?> function)
    Logs output of a custom function at the WARN level.

    Methods inherited from class java.lang.Object

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

    • JdkLogger

      public JdkLogger(Logger logger)
      Default constructor.
      Parameters:
      logger - non-null JDK logger
  • Method Details

    • log

      protected void log(Level level, LogMessage msg)
    • isDebugEnabled

      public boolean isDebugEnabled()
      Description copied from interface: Logger
      Checks if logging level is DEBUG or above.
      Specified by:
      isDebugEnabled in interface Logger
      Returns:
      true if DEBUG level is enabled; false otherwise
    • isErrorEnabled

      public boolean isErrorEnabled()
      Description copied from interface: Logger
      Checks if logging level is ERROR or above.
      Specified by:
      isErrorEnabled in interface Logger
      Returns:
      true if ERROR level is enabled; false otherwise
    • isInfoEnabled

      public boolean isInfoEnabled()
      Description copied from interface: Logger
      Checks if logging level is INFO or above.
      Specified by:
      isInfoEnabled in interface Logger
      Returns:
      true if INFO level is enabled; false otherwise
    • isWarnEnabled

      public boolean isWarnEnabled()
      Description copied from interface: Logger
      Checks if logging level is WARN or above.
      Specified by:
      isWarnEnabled in interface Logger
      Returns:
      true if WARN level is enabled; false otherwise
    • isTraceEnabled

      public boolean isTraceEnabled()
      Description copied from interface: Logger
      Checks if logging level is TRACE or above.
      Specified by:
      isTraceEnabled in interface Logger
      Returns:
      true if TRACE level is enabled; false otherwise
    • debug

      public void debug(Supplier<?> function)
      Description copied from interface: Logger
      Logs output of a custom function at the DEBUG level. The function will only run when log level is DEBUG or lower.
      Specified by:
      debug in interface Logger
      Parameters:
      function - custom function to run
    • debug

      public void debug(Object format, Object... arguments)
      Description copied from interface: Logger
      Logs a message at the DEBUG level according to the specified format and arguments.
      Specified by:
      debug in interface Logger
      Parameters:
      format - the format string
      arguments - a list of arguments, the last one could be a Throwable
    • debug

      public void debug(Object message, Throwable t)
      Description copied from interface: Logger
      Logs an error (see Throwable) at the DEBUG level with an accompanying message.
      Specified by:
      debug in interface Logger
      Parameters:
      message - the message accompanying the error
      t - the error to log
    • error

      public void error(Supplier<?> function)
      Description copied from interface: Logger
      Logs output of a custom function at the ERROR level. The function will only run when log level is ERROR or lower.
      Specified by:
      error in interface Logger
      Parameters:
      function - custom function to run
    • error

      public void error(Object format, Object... arguments)
      Description copied from interface: Logger
      Logs a message at the ERROR level according to the specified format and arguments.
      Specified by:
      error in interface Logger
      Parameters:
      format - the format string
      arguments - a list of arguments, the last one could be a Throwable
    • error

      public void error(Object message, Throwable t)
      Description copied from interface: Logger
      Logs an error (see Throwable) at the ERROR level with an accompanying message.
      Specified by:
      error in interface Logger
      Parameters:
      message - the message accompanying the error
      t - the error to log
    • info

      public void info(Supplier<?> function)
      Description copied from interface: Logger
      Logs output of a custom function at the INFO level. The function will only run when log level is INFO or lower.
      Specified by:
      info in interface Logger
      Parameters:
      function - custom function to run
    • info

      public void info(Object format, Object... arguments)
      Description copied from interface: Logger
      Logs a message at the INFO level according to the specified format and arguments.
      Specified by:
      info in interface Logger
      Parameters:
      format - the format string
      arguments - a list of arguments, the last one could be a Throwable
    • info

      public void info(Object message, Throwable t)
      Description copied from interface: Logger
      Logs an error (see Throwable) at the INFO level with an accompanying message.
      Specified by:
      info in interface Logger
      Parameters:
      message - the message accompanying the error
      t - the error to log
    • trace

      public void trace(Supplier<?> function)
      Description copied from interface: Logger
      Logs output of a custom function at the TRACE level. The function will only run when log level is TRACE.
      Specified by:
      trace in interface Logger
      Parameters:
      function - custom function to run
    • trace

      public void trace(Object format, Object... arguments)
      Description copied from interface: Logger
      Logs a message at the TRACE level according to the specified format and arguments.
      Specified by:
      trace in interface Logger
      Parameters:
      format - the format string
      arguments - a list of arguments, the last one could be a Throwable
    • trace

      public void trace(Object message, Throwable t)
      Description copied from interface: Logger
      Logs an error (see Throwable) at the TRACE level with an accompanying message.
      Specified by:
      trace in interface Logger
      Parameters:
      message - the message accompanying the error
      t - the error to log
    • warn

      public void warn(Supplier<?> function)
      Description copied from interface: Logger
      Logs output of a custom function at the WARN level. The function will only run when log level is WARN or lower.
      Specified by:
      warn in interface Logger
      Parameters:
      function - custom function to run
    • warn

      public void warn(Object format, Object... arguments)
      Description copied from interface: Logger
      Logs a message at the WARN level according to the specified format and arguments.
      Specified by:
      warn in interface Logger
      Parameters:
      format - the format string
      arguments - a list of arguments, the last one could be a Throwable
    • warn

      public void warn(Object message, Throwable t)
      Description copied from interface: Logger
      Logs an error (see Throwable) at the WRAN level with an accompanying message.
      Specified by:
      warn in interface Logger
      Parameters:
      message - the message accompanying the error
      t - the error to log
    • unwrap

      public Object unwrap()
      Description copied from interface: Logger
      Return logger implementation.
      Specified by:
      unwrap in interface Logger
      Returns:
      implementation