Module org.snmp4j

Class ConsoleLogAdapter

  • All Implemented Interfaces:
    LogAdapter

    public class ConsoleLogAdapter
    extends java.lang.Object
    implements LogAdapter
    The ConsoleLogAdapter provides simple logging to the console.
    Since:
    1.6
    Version:
    3.0
    Author:
    Frank Fock
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void debug​(java.io.Serializable message)
      Logs a debug message.
      void error​(java.io.Serializable message)
      Logs an error message.
      void error​(java.lang.CharSequence message, java.lang.Throwable throwable)
      Logs an error message.
      void fatal​(java.lang.CharSequence message, java.lang.Throwable throwable)
      Logs a fatal message.
      void fatal​(java.lang.Object message)
      Logs a fatal message.
      static java.text.DateFormat getDateAndTimeFormat()  
      LogLevel getEffectiveLogLevel()
      Returns the log level that is effective for this log adapter.
      java.util.Iterator<?> getLogHandler()
      Returns the log handlers associated with this logger.
      LogLevel getLogLevel()
      Returns the log level defined for this log adapter.
      java.lang.String getName()
      Returns the name of the logger.
      void info​(java.lang.CharSequence message)
      Logs an informational message.
      boolean isDebugEnabled()
      Checks whether DEBUG level logging is activated for this log adapter.
      boolean isInfoEnabled()
      Checks whether INFO level logging is activated for this log adapter.
      boolean isWarnEnabled()
      Checks whether WARN level logging is activated for this log adapter.
      static void setDateAndTimeFormat​(java.text.DateFormat dateAndTimeFormat)  
      static void setDebugEnabled​(boolean isDebugEnabled)  
      static void setInfoEnabled​(boolean isInfoEnabled)  
      void setLogLevel​(LogLevel level)
      Sets the log level for this log adapter (if applicable).
      static void setWarnEnabled​(boolean isWarnEnabled)  
      void warn​(java.io.Serializable message)
      Logs an warning message.
      • Methods inherited from class java.lang.Object

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

      • ConsoleLogAdapter

        public ConsoleLogAdapter()
    • Method Detail

      • debug

        public void debug​(java.io.Serializable message)
        Logs a debug message.
        Specified by:
        debug in interface LogAdapter
        Parameters:
        message - the message to log.
      • error

        public void error​(java.io.Serializable message)
        Logs an error message.
        Specified by:
        error in interface LogAdapter
        Parameters:
        message - the message to log.
      • error

        public void error​(java.lang.CharSequence message,
                          java.lang.Throwable throwable)
        Logs an error message.
        Specified by:
        error in interface LogAdapter
        Parameters:
        message - the message to log.
        throwable - the exception that caused to error.
      • fatal

        public void fatal​(java.lang.Object message)
        Logs a fatal message.
        Specified by:
        fatal in interface LogAdapter
        Parameters:
        message - the message to log.
      • fatal

        public void fatal​(java.lang.CharSequence message,
                          java.lang.Throwable throwable)
        Logs a fatal message.
        Specified by:
        fatal in interface LogAdapter
        Parameters:
        message - the message to log.
        throwable - the exception that caused to error.
      • info

        public void info​(java.lang.CharSequence message)
        Logs an informational message.
        Specified by:
        info in interface LogAdapter
        Parameters:
        message - the message to log.
      • isDebugEnabled

        public boolean isDebugEnabled()
        Checks whether DEBUG level logging is activated for this log adapter.
        Specified by:
        isDebugEnabled in interface LogAdapter
        Returns:
        true if logging is enabled or false otherwise.
      • isInfoEnabled

        public boolean isInfoEnabled()
        Checks whether INFO level logging is activated for this log adapter.
        Specified by:
        isInfoEnabled in interface LogAdapter
        Returns:
        true if logging is enabled or false otherwise.
      • isWarnEnabled

        public boolean isWarnEnabled()
        Checks whether WARN level logging is activated for this log adapter.
        Specified by:
        isWarnEnabled in interface LogAdapter
        Returns:
        true if logging is enabled or false otherwise.
      • warn

        public void warn​(java.io.Serializable message)
        Logs an warning message.
        Specified by:
        warn in interface LogAdapter
        Parameters:
        message - the message to log.
      • setDebugEnabled

        public static void setDebugEnabled​(boolean isDebugEnabled)
      • setWarnEnabled

        public static void setWarnEnabled​(boolean isWarnEnabled)
      • setInfoEnabled

        public static void setInfoEnabled​(boolean isInfoEnabled)
      • setLogLevel

        public void setLogLevel​(LogLevel level)
        Description copied from interface: LogAdapter
        Sets the log level for this log adapter (if applicable).
        Specified by:
        setLogLevel in interface LogAdapter
        Parameters:
        level - a LogLevel instance.
      • getName

        public java.lang.String getName()
        Description copied from interface: LogAdapter
        Returns the name of the logger.
        Specified by:
        getName in interface LogAdapter
        Returns:
        the name of the logger.
      • getLogLevel

        public LogLevel getLogLevel()
        Description copied from interface: LogAdapter
        Returns the log level defined for this log adapter.
        Specified by:
        getLogLevel in interface LogAdapter
        Returns:
        a LogLevel instance.
      • getEffectiveLogLevel

        public LogLevel getEffectiveLogLevel()
        Description copied from interface: LogAdapter
        Returns the log level that is effective for this log adapter. The effective log level is the first log level different from LogLevel.NONE to the root.
        Specified by:
        getEffectiveLogLevel in interface LogAdapter
        Returns:
        a LogLevel different than LogLevel.NONE.
      • getLogHandler

        public java.util.Iterator<?> getLogHandler()
        Description copied from interface: LogAdapter
        Returns the log handlers associated with this logger.
        Specified by:
        getLogHandler in interface LogAdapter
        Returns:
        an Iterator of log system dependent log handlers.
      • getDateAndTimeFormat

        public static java.text.DateFormat getDateAndTimeFormat()
      • setDateAndTimeFormat

        public static void setDateAndTimeFormat​(java.text.DateFormat dateAndTimeFormat)