nxt.util

## Class Logger

- java.lang.Object
- - nxt.util.Logger

-     public final class Logger
      extends java.lang.Object

  Handle logging for the Nxt node server

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Logger.Event` Log event types
    `static class` | `Logger.Level` Log levels

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `addExceptionListener(Listener<java.lang.Throwable> listener, Logger.Event eventType)` Add an exception listener
    `static boolean` | `addMessageListener(Listener<java.lang.String> listener, Logger.Event eventType)` Add a message listener
    `static void` | `init()` Logger initialization
    `static boolean` | `isDebugEnabled()`
    `static boolean` | `isErrorEnabled()`
    `static boolean` | `isInfoEnabled()`
    `static boolean` | `isWarningEnabled()`
    `static void` | `logDebugMessage(java.lang.String message)` Log a debug message
    `static void` | `logDebugMessage(java.lang.String format, java.lang.Object... args)` Log a debug message
    `static void` | `logDebugMessage(java.lang.String message, java.lang.Throwable exc)` Log a debug exception
    `static void` | `logErrorMessage(java.lang.String message)` Log an ERROR message
    `static void` | `logErrorMessage(java.lang.String format, java.lang.Object... args)` Log an ERROR message
    `static void` | `logErrorMessage(java.lang.String message, java.lang.Throwable exc)` Log an ERROR exception
    `static void` | `logInfoMessage(java.lang.String message)` Log an INFO message
    `static void` | `logInfoMessage(java.lang.String format, java.lang.Object... args)` Log an INFO message
    `static void` | `logInfoMessage(java.lang.String message, java.lang.Throwable exc)` Log an INFO exception
    `static void` | `logMessage(java.lang.String message)` Log a message (map to INFO)
    `static void` | `logMessage(java.lang.String message, java.lang.Exception exc)` Log an exception (map to ERROR)
    `static void` | `logShutdownMessage(java.lang.String message)`
    `static void` | `logShutdownMessage(java.lang.String message, java.lang.Exception e)`
    `static void` | `logWarningMessage(java.lang.String message)` Log a WARNING message
    `static void` | `logWarningMessage(java.lang.String format, java.lang.Object... args)`
    `static void` | `logWarningMessage(java.lang.String message, java.lang.Throwable exc)` Log a WARNING exception
    `static boolean` | `removeExceptionListener(Listener<java.lang.Throwable> listener, Logger.Event eventType)` Remove an exception listener
    `static boolean` | `removeMessageListener(Listener<java.lang.String> listener, Logger.Event eventType)` Remove a message listener
    `static void` | `setLevel(Logger.Level level)` Set the log level
    `static void` | `shutdown()` Logger shutdown

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### init

          public static void init()

      Logger initialization

    - #### shutdown

          public static void shutdown()

      Logger shutdown

    - #### setLevel

          public static void setLevel(Logger.Level level)

      Set the log level
      Parameters:
        `level` - Desired log level

    - #### addMessageListener

          public static boolean addMessageListener(Listener<java.lang.String> listener,
                                                   Logger.Event eventType)

      Add a message listener
      Parameters:
        `listener` - Listener
        `eventType` - Notification event type
      Returns:
        TRUE if listener added

    - #### addExceptionListener

          public static boolean addExceptionListener(Listener<java.lang.Throwable> listener,
                                                     Logger.Event eventType)

      Add an exception listener
      Parameters:
        `listener` - Listener
        `eventType` - Notification event type
      Returns:
        TRUE if listener added

    - #### removeMessageListener

          public static boolean removeMessageListener(Listener<java.lang.String> listener,
                                                      Logger.Event eventType)

      Remove a message listener
      Parameters:
        `listener` - Listener
        `eventType` - Notification event type
      Returns:
        TRUE if listener removed

    - #### removeExceptionListener

          public static boolean removeExceptionListener(Listener<java.lang.Throwable> listener,
                                                        Logger.Event eventType)

      Remove an exception listener
      Parameters:
        `listener` - Listener
        `eventType` - Notification event type
      Returns:
        TRUE if listener removed

    - #### logMessage

          public static void logMessage(java.lang.String message)

      Log a message (map to INFO)
      Parameters:
        `message` - Message

    - #### logMessage

          public static void logMessage(java.lang.String message,
                                        java.lang.Exception exc)

      Log an exception (map to ERROR)
      Parameters:
        `message` - Message
        `exc` - Exception

    - #### logShutdownMessage

          public static void logShutdownMessage(java.lang.String message)

    - #### logShutdownMessage

          public static void logShutdownMessage(java.lang.String message,
                                                java.lang.Exception e)

    - #### isErrorEnabled

          public static boolean isErrorEnabled()

    - #### logErrorMessage

          public static void logErrorMessage(java.lang.String message)

      Log an ERROR message
      Parameters:
        `message` - Message

    - #### logErrorMessage

          public static void logErrorMessage(java.lang.String format,
                                             java.lang.Object... args)

      Log an ERROR message
      Parameters:
        `format` - Message format
        `args` - Message args

    - #### logErrorMessage

          public static void logErrorMessage(java.lang.String message,
                                             java.lang.Throwable exc)

      Log an ERROR exception
      Parameters:
        `message` - Message
        `exc` - Exception

    - #### isWarningEnabled

          public static boolean isWarningEnabled()

    - #### logWarningMessage

          public static void logWarningMessage(java.lang.String message)

      Log a WARNING message
      Parameters:
        `message` - Message

    - #### logWarningMessage

          public static void logWarningMessage(java.lang.String format,
                                               java.lang.Object... args)

    - #### logWarningMessage

          public static void logWarningMessage(java.lang.String message,
                                               java.lang.Throwable exc)

      Log a WARNING exception
      Parameters:
        `message` - Message
        `exc` - Exception

    - #### isInfoEnabled

          public static boolean isInfoEnabled()

    - #### logInfoMessage

          public static void logInfoMessage(java.lang.String message)

      Log an INFO message
      Parameters:
        `message` - Message

    - #### logInfoMessage

          public static void logInfoMessage(java.lang.String format,
                                            java.lang.Object... args)

      Log an INFO message
      Parameters:
        `format` - Message format
        `args` - Message args

    - #### logInfoMessage

          public static void logInfoMessage(java.lang.String message,
                                            java.lang.Throwable exc)

      Log an INFO exception
      Parameters:
        `message` - Message
        `exc` - Exception

    - #### isDebugEnabled

          public static boolean isDebugEnabled()

    - #### logDebugMessage

          public static void logDebugMessage(java.lang.String message)

      Log a debug message
      Parameters:
        `message` - Message

    - #### logDebugMessage

          public static void logDebugMessage(java.lang.String format,
                                             java.lang.Object... args)

      Log a debug message
      Parameters:
        `format` - Message format
        `args` - Message args

    - #### logDebugMessage

          public static void logDebugMessage(java.lang.String message,
                                             java.lang.Throwable exc)

      Log a debug exception
      Parameters:
        `message` - Message
        `exc` - Exception