Class OnceLogger

  • All Implemented Interfaces:
    org.slf4j.Logger

    public class OnceLogger
    extends org.slf4j.ext.LoggerWrapper
    Provides calling code a way to log important messages only once, regardless of how many times the invocation has occurred. This can be used, for instance, to log a warning like "One or more schemas aren't declared" without logging that message for every time the schema is mentioned in a document. This implementation currently only supports single-argument string literal log methods (e.g. Logger.debug(String)).
    • Field Summary

      • Fields inherited from class org.slf4j.ext.LoggerWrapper

        instanceofLAL, logger
      • Fields inherited from interface org.slf4j.Logger

        ROOT_LOGGER_NAME
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void debug​(String msg)
      Delegate to the appropriate method of the underlying logger.
      void error​(String msg)
      Delegate to the appropriate method of the underlying logger.
      void info​(String msg)
      Delegate to the appropriate method of the underlying logger.
      static org.slf4j.Logger once​(org.slf4j.Logger logger)  
      void trace​(String msg)
      Delegate to the appropriate method of the underlying logger.
      void warn​(String msg)
      Delegate to the appropriate method of the underlying logger.
      • Methods inherited from class org.slf4j.ext.LoggerWrapper

        debug, debug, debug, debug, debug, debug, debug, debug, debug, error, error, error, error, error, error, error, error, error, getName, info, info, info, info, info, info, info, info, info, isDebugEnabled, isDebugEnabled, isErrorEnabled, isErrorEnabled, isInfoEnabled, isInfoEnabled, isTraceEnabled, isTraceEnabled, isWarnEnabled, isWarnEnabled, trace, trace, trace, trace, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn, warn, warn, warn, warn
    • Method Detail

      • once

        public static org.slf4j.Logger once​(org.slf4j.Logger logger)
      • trace

        public void trace​(String msg)
        Delegate to the appropriate method of the underlying logger.
        Specified by:
        trace in interface org.slf4j.Logger
        Overrides:
        trace in class org.slf4j.ext.LoggerWrapper
        Parameters:
        msg - The log message.
      • debug

        public void debug​(String msg)
        Delegate to the appropriate method of the underlying logger.
        Specified by:
        debug in interface org.slf4j.Logger
        Overrides:
        debug in class org.slf4j.ext.LoggerWrapper
        Parameters:
        msg - The log message.
      • info

        public void info​(String msg)
        Delegate to the appropriate method of the underlying logger.
        Specified by:
        info in interface org.slf4j.Logger
        Overrides:
        info in class org.slf4j.ext.LoggerWrapper
        Parameters:
        msg - The log message.
      • warn

        public void warn​(String msg)
        Delegate to the appropriate method of the underlying logger.
        Specified by:
        warn in interface org.slf4j.Logger
        Overrides:
        warn in class org.slf4j.ext.LoggerWrapper
        Parameters:
        msg - The log message.
      • error

        public void error​(String msg)
        Delegate to the appropriate method of the underlying logger. Use this method sparingly. If you're limiting error messages, ask yourself whether your log fits better as a warning.
        Specified by:
        error in interface org.slf4j.Logger
        Overrides:
        error in class org.slf4j.ext.LoggerWrapper
        Parameters:
        msg - The log message.