Class Logger

java.lang.Object
com.teamdev.jxbrowser.logging.Logger

public final class Logger extends Object
Static class to configure log and create log entries.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    debug(String message)
    Logs a DEBUG message.
    static void
    debug(String message, Object... arguments)
    Logs a DEBUG message with the given arguments.
    static void
    debug(String message, Throwable exception)
    Logs a DEBUG message with the given exception.
    static void
    debug(String message, Supplier<String> parameterSupplier)
    Logs an ERROR message with a given lazy calculated parameter.
    static void
    debug(Supplier<String> msgSupplier)
    Logs a lazily constructed DEBUG message.
    static void
    error(String message)
    Logs an ERROR message.
    static void
    error(String message, Object... arguments)
    Logs an ERROR message with the given arguments.
    static void
    error(String message, Throwable exception)
    Logs an ERROR message with the given exception.
    static void
    error(String message, Throwable exception, Object... arguments)
    Logs an ERROR message with the given exception and arguments.
    static void
    error(String message, Throwable exception, Supplier<String> parameterSupplier)
    Logs an ERROR message with the given exception and a lazy calculated parameter.
    static void
    info(String message)
    Logs an INFO message.
    static void
    info(String message, Object... arguments)
    Logs an INFO message with the given arguments.
    static boolean
    Checks whether log entries at DEBUG level will be output.
    static boolean
    Checks whether log entries at ERROR level will be output.
    static boolean
    Checks whether log entries at INFO level will be output.
    static boolean
    Checks whether log entries at TRACE level will be output.
    static boolean
    Checks whether log entries at WARNING level will be output.
    static Level
    Returns the current log level specifying which message levels will be logged.
    static void
    level(Level level)
    Sets the log level specifying which message levels will be logged.
    static void
    off()
    Disables logging by setting the log level to Level.OFF.
    static void
    trace(String message, Object... arguments)
    Logs a TRACE message with the given arguments.
    static void
    trace(Supplier<String> msgSupplier)
    Logs a lazily constructed TRACE message.
    static void
    warn(String message)
    Logs a WARNING message.
    static void
    warn(String message, Object... arguments)
    Logs a WARNING message with the given arguments.
    static void
    warn(String message, Throwable exception)
    Logs a WARNING message with the given exception.
    static void
    warn(Throwable exception, Supplier<String> msgSupplier)
    Logs a lazily constructed WARNING message with the given exception.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • level

      public static Level level()
      Returns the current log level specifying which message levels will be logged.
    • level

      public static void level(Level level)
      Sets the log level specifying which message levels will be logged. Message levels lower than this value will be discarded. The Level.OFF value can be used to turn off logging.
      Parameters:
      level - the new value for the log level
    • off

      public static void off()
      Disables logging by setting the log level to Level.OFF.
    • error

      public static void error(String message)
      Logs an ERROR message.
      Parameters:
      message - the message to log
    • error

      public static void error(String message, Object... arguments)
      Logs an ERROR message with the given arguments.
      Parameters:
      message - the message to log
      arguments - the array of arguments to the message
    • error

      public static void error(String message, Throwable exception)
      Logs an ERROR message with the given exception.
      Parameters:
      message - the message to log
      exception - the Throwable associated with the log message
    • error

      public static void error(String message, Throwable exception, Supplier<String> parameterSupplier)
      Logs an ERROR message with the given exception and a lazy calculated parameter.
      Parameters:
      message - the message to log
      exception - the Throwable associated with the log message
      parameterSupplier - a function, which when called, produces the desired log message parameter
    • error

      public static void error(String message, Throwable exception, Object... arguments)
      Logs an ERROR message with the given exception and arguments.
      Parameters:
      message - the message to log
      exception - the Throwable associated with the log message
      arguments - the array of arguments to the message
    • info

      public static void info(String message)
      Logs an INFO message.
      Parameters:
      message - the message to log
    • info

      public static void info(String message, Object... arguments)
      Logs an INFO message with the given arguments.
      Parameters:
      message - the message to log
      arguments - the array of arguments to the message
    • warn

      public static void warn(String message)
      Logs a WARNING message.
      Parameters:
      message - the message to log
    • warn

      public static void warn(String message, Object... arguments)
      Logs a WARNING message with the given arguments.
      Parameters:
      message - the message to log
      arguments - the array of arguments to the message
    • warn

      public static void warn(String message, Throwable exception)
      Logs a WARNING message with the given exception.
      Parameters:
      message - the message to log
      exception - the Throwable associated with the log message
    • warn

      public static void warn(Throwable exception, Supplier<String> msgSupplier)
      Logs a lazily constructed WARNING message with the given exception.
      Parameters:
      exception - the Throwable associated with the log message
      msgSupplier - a function, which when called, produces the desired log message
    • debug

      public static void debug(String message)
      Logs a DEBUG message.
      Parameters:
      message - the message to log
    • debug

      public static void debug(String message, Throwable exception)
      Logs a DEBUG message with the given exception.
      Parameters:
      message - the message to log
      exception - the Throwable associated with the log message
    • debug

      public static void debug(Supplier<String> msgSupplier)
      Logs a lazily constructed DEBUG message.
      Parameters:
      msgSupplier - a function, which when called, produces the desired log message
    • debug

      public static void debug(String message, Object... arguments)
      Logs a DEBUG message with the given arguments.
      Parameters:
      message - the message to log
      arguments - the array of arguments to the message
    • debug

      public static void debug(String message, Supplier<String> parameterSupplier)
      Logs an ERROR message with a given lazy calculated parameter.
      Parameters:
      message - the message to log
      parameterSupplier - a function, which when called, produces the desired log message parameter
    • trace

      public static void trace(String message, Object... arguments)
      Logs a TRACE message with the given arguments.
      Parameters:
      message - the message to log
      arguments - the array of arguments to the message
    • trace

      public static void trace(Supplier<String> msgSupplier)
      Logs a lazily constructed TRACE message.
      Parameters:
      msgSupplier - a function, which when called, produces the desired log message
    • isErrorEnabled

      public static boolean isErrorEnabled()
      Checks whether log entries at ERROR level will be output.
    • isWarnEnabled

      public static boolean isWarnEnabled()
      Checks whether log entries at WARNING level will be output.
    • isInfoEnabled

      public static boolean isInfoEnabled()
      Checks whether log entries at INFO level will be output.
    • isDebugEnabled

      public static boolean isDebugEnabled()
      Checks whether log entries at DEBUG level will be output.
    • isTraceEnabled

      public static boolean isTraceEnabled()
      Checks whether log entries at TRACE level will be output.