Interface LogAdapter

All Known Implementing Classes:
ConsoleLogAdapter, JavaLogAdapter, LogProxy, NoLogger

public interface LogAdapter
The LogAdapter specifies the logging interface used by SNMP4J. To provide another logging mechanism as the default no-logging the static method LogFactory.setLogFactory(org.snmp4j.log.LogFactory) can be used to assign a different logging adapter factory.
Since:
1.2.1
Version:
1.6.1
Author:
Frank Fock
  • Method Details

    • isDebugEnabled

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

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

      boolean isWarnEnabled()
      Checks whether WARN level logging is activated for this log adapter.
      Returns:
      true if logging is enabled or false otherwise.
    • debug

      void debug(Serializable message)
      Logs a debug message.
      Parameters:
      message - the message to log.
    • info

      void info(CharSequence message)
      Logs an informational message.
      Parameters:
      message - the message to log.
    • warn

      void warn(Serializable message)
      Logs an warning message.
      Parameters:
      message - the message to log.
    • error

      void error(Serializable message)
      Logs an error message.
      Parameters:
      message - the message to log.
    • error

      void error(CharSequence message, Throwable throwable)
      Logs an error message.
      Parameters:
      message - the message to log.
      throwable - the exception that caused to error.
    • fatal

      void fatal(Object message)
      Logs a fatal message.
      Parameters:
      message - the message to log.
    • fatal

      void fatal(CharSequence message, Throwable throwable)
      Logs a fatal message.
      Parameters:
      message - the message to log.
      throwable - the exception that caused to error.
    • setLogLevel

      void setLogLevel(LogLevel level)
      Sets the log level for this log adapter (if applicable).
      Parameters:
      level - a LogLevel instance.
      Since:
      1.6.1
    • getLogLevel

      LogLevel getLogLevel()
      Returns the log level defined for this log adapter.
      Returns:
      a LogLevel instance.
      Since:
      1.6.1
    • getEffectiveLogLevel

      LogLevel getEffectiveLogLevel()
      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.
      Returns:
      a LogLevel different than LogLevel.NONE.
      Since:
      1.6.1
    • getName

      String getName()
      Returns the name of the logger.
      Returns:
      the name of the logger.
    • getLogHandler

      Iterator getLogHandler()
      Returns the log handlers associated with this logger.
      Returns:
      an Iterator of log system dependent log handlers.
      Since:
      1.6.1