Package nxt.util

Class Logger


  • public final class Logger
    extends java.lang.Object
    Handle logging for the Nxt node server
    • 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