Module org.snmp4j

Class LogProxy

java.lang.Object
org.snmp4j.log.LogProxy
All Implemented Interfaces:
LogAdapter

public class LogProxy extends Object implements LogAdapter
A LogProxy can be used for late binding loggers. A proxy does not log anything, if its logger member is null. Otherwise it forwards all its messages to that logger. Even if the proxy logger is not set, the LogProxy has a name.
Version:
3.4.1
Author:
Frank Fock
  • Constructor Details

    • LogProxy

      public LogProxy(String name)
    • LogProxy

      public LogProxy(LogAdapter logger)
  • Method Details

    • debug

      public void debug(Serializable message)
      Description copied from interface: LogAdapter
      Logs a debug message.
      Specified by:
      debug in interface LogAdapter
      Parameters:
      message - the message to log.
    • error

      public void error(Serializable message)
      Description copied from interface: LogAdapter
      Logs an error message.
      Specified by:
      error in interface LogAdapter
      Parameters:
      message - the message to log.
    • error

      public void error(CharSequence message, Throwable throwable)
      Description copied from interface: LogAdapter
      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(Object message)
      Description copied from interface: LogAdapter
      Logs a fatal message.
      Specified by:
      fatal in interface LogAdapter
      Parameters:
      message - the message to log.
    • fatal

      public void fatal(CharSequence message, Throwable throwable)
      Description copied from interface: LogAdapter
      Logs a fatal message.
      Specified by:
      fatal in interface LogAdapter
      Parameters:
      message - the message to log.
      throwable - the exception that caused to error.
    • 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 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.
    • 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.
    • getName

      public 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.
    • info

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

      public boolean isDebugEnabled()
      Description copied from interface: LogAdapter
      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()
      Description copied from interface: LogAdapter
      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()
      Description copied from interface: LogAdapter
      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.
    • 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.
    • warn

      public void warn(Serializable message)
      Description copied from interface: LogAdapter
      Logs an warning message.
      Specified by:
      warn in interface LogAdapter
      Parameters:
      message - the message to log.
    • getLogger

      public LogAdapter getLogger()
      Gets the proxied logger.
      Returns:
      a LogAdapter the actually logs the messages.
    • setLogger

      public void setLogger(LogAdapter logger)
      Sets the logger that logs the log messages logged with this proxy.
      Parameters:
      logger - a LogAdapter.
    • log

      public void log(LogLevel logLevel, CharSequence message, Throwable throwable)
      Description copied from interface: LogAdapter
      Log a message with the specified level.
      Specified by:
      log in interface LogAdapter
      Parameters:
      logLevel - the level at which the message will be logged.
      message - the message to log.
      throwable - an optional exception associated with the log event.