Class MockLogger

  • All Implemented Interfaces:
    Serializable, org.slf4j.Logger

    public class MockLogger
    extends org.slf4j.helpers.MarkerIgnoringBase

    Simple implementation of Logger based on SimpleLogger from SLF4J

    This implementation is heavily inspired by Apache Commons Logging's SimpleLog.

    Author:
    Ceki Gülcü, Scott Sanders, Rod Waldhoff, Robert Burrell Donkin, Cédrik LIME
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void debug​(String msg)
      A simple implementation which logs messages of level DEBUG according to the format outlined above.
      void debug​(String format, Object param1)
      Perform single parameter substitution before logging the message of level DEBUG according to the format outlined above.
      void debug​(String format, Object... argArray)
      Perform double parameter substitution before logging the message of level DEBUG according to the format outlined above.
      void debug​(String format, Object param1, Object param2)
      Perform double parameter substitution before logging the message of level DEBUG according to the format outlined above.
      void debug​(String msg, Throwable t)
      Log a message of level DEBUG, including an exception.
      void error​(String msg)
      A simple implementation which always logs messages of level ERROR according to the format outlined above.
      void error​(String format, Object arg)
      Perform single parameter substitution before logging the message of level ERROR according to the format outlined above.
      void error​(String format, Object... argArray)
      Perform double parameter substitution before logging the message of level ERROR according to the format outlined above.
      void error​(String format, Object arg1, Object arg2)
      Perform double parameter substitution before logging the message of level ERROR according to the format outlined above.
      void error​(String msg, Throwable t)
      Log a message of level ERROR, including an exception.
      String getName()  
      void info​(String msg)
      A simple implementation which logs messages of level INFO according to the format outlined above.
      void info​(String format, Object arg)
      Perform single parameter substitution before logging the message of level INFO according to the format outlined above.
      void info​(String format, Object... argArray)
      Perform double parameter substitution before logging the message of level INFO according to the format outlined above.
      void info​(String format, Object arg1, Object arg2)
      Perform double parameter substitution before logging the message of level INFO according to the format outlined above.
      void info​(String msg, Throwable t)
      Log a message of level INFO, including an exception.
      boolean isDebugEnabled()
      Are debug messages currently enabled?
      boolean isErrorEnabled()
      Are error messages currently enabled?
      boolean isInfoEnabled()
      Are info messages currently enabled?
      protected boolean isLevelEnabled​(Level logLevel)
      Is the given log level currently enabled?
      boolean isTraceEnabled()
      Are trace messages currently enabled?
      boolean isWarnEnabled()
      Are warn messages currently enabled?
      protected Object readResolve()  
      void trace​(String msg)
      A simple implementation which logs messages of level TRACE according to the format outlined above.
      void trace​(String format, Object param1)
      Perform single parameter substitution before logging the message of level TRACE according to the format outlined above.
      void trace​(String format, Object... argArray)
      Perform double parameter substitution before logging the message of level TRACE according to the format outlined above.
      void trace​(String format, Object param1, Object param2)
      Perform double parameter substitution before logging the message of level TRACE according to the format outlined above.
      void trace​(String msg, Throwable t)
      Log a message of level TRACE, including an exception.
      void warn​(String msg)
      A simple implementation which always logs messages of level WARN according to the format outlined above.
      void warn​(String format, Object arg)
      Perform single parameter substitution before logging the message of level WARN according to the format outlined above.
      void warn​(String format, Object... argArray)
      Perform double parameter substitution before logging the message of level WARN according to the format outlined above.
      void warn​(String format, Object arg1, Object arg2)
      Perform double parameter substitution before logging the message of level WARN according to the format outlined above.
      void warn​(String msg, Throwable t)
      Log a message of level WARN, including an exception.
      • Methods inherited from class org.slf4j.helpers.MarkerIgnoringBase

        debug, debug, debug, debug, debug, error, error, error, error, error, info, info, info, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isTraceEnabled, isWarnEnabled, toString, trace, trace, trace, trace, trace, warn, warn, warn, warn, warn
      • Methods inherited from interface org.slf4j.Logger

        getName
    • Method Detail

      • isLevelEnabled

        protected boolean isLevelEnabled​(Level logLevel)
        Is the given log level currently enabled?
        Parameters:
        logLevel - is this level enabled?
      • isTraceEnabled

        public boolean isTraceEnabled()
        Are trace messages currently enabled?
      • trace

        public void trace​(String msg)
        A simple implementation which logs messages of level TRACE according to the format outlined above.
      • trace

        public void trace​(String format,
                          Object param1)
        Perform single parameter substitution before logging the message of level TRACE according to the format outlined above.
      • trace

        public void trace​(String format,
                          Object param1,
                          Object param2)
        Perform double parameter substitution before logging the message of level TRACE according to the format outlined above.
      • trace

        public void trace​(String format,
                          Object... argArray)
        Perform double parameter substitution before logging the message of level TRACE according to the format outlined above.
      • trace

        public void trace​(String msg,
                          Throwable t)
        Log a message of level TRACE, including an exception.
      • isDebugEnabled

        public boolean isDebugEnabled()
        Are debug messages currently enabled?
      • debug

        public void debug​(String msg)
        A simple implementation which logs messages of level DEBUG according to the format outlined above.
      • debug

        public void debug​(String format,
                          Object param1)
        Perform single parameter substitution before logging the message of level DEBUG according to the format outlined above.
      • debug

        public void debug​(String format,
                          Object param1,
                          Object param2)
        Perform double parameter substitution before logging the message of level DEBUG according to the format outlined above.
      • debug

        public void debug​(String format,
                          Object... argArray)
        Perform double parameter substitution before logging the message of level DEBUG according to the format outlined above.
      • debug

        public void debug​(String msg,
                          Throwable t)
        Log a message of level DEBUG, including an exception.
      • isInfoEnabled

        public boolean isInfoEnabled()
        Are info messages currently enabled?
      • info

        public void info​(String msg)
        A simple implementation which logs messages of level INFO according to the format outlined above.
      • info

        public void info​(String format,
                         Object arg)
        Perform single parameter substitution before logging the message of level INFO according to the format outlined above.
      • info

        public void info​(String format,
                         Object arg1,
                         Object arg2)
        Perform double parameter substitution before logging the message of level INFO according to the format outlined above.
      • info

        public void info​(String format,
                         Object... argArray)
        Perform double parameter substitution before logging the message of level INFO according to the format outlined above.
      • info

        public void info​(String msg,
                         Throwable t)
        Log a message of level INFO, including an exception.
      • isWarnEnabled

        public boolean isWarnEnabled()
        Are warn messages currently enabled?
      • warn

        public void warn​(String msg)
        A simple implementation which always logs messages of level WARN according to the format outlined above.
      • warn

        public void warn​(String format,
                         Object arg)
        Perform single parameter substitution before logging the message of level WARN according to the format outlined above.
      • warn

        public void warn​(String format,
                         Object arg1,
                         Object arg2)
        Perform double parameter substitution before logging the message of level WARN according to the format outlined above.
      • warn

        public void warn​(String format,
                         Object... argArray)
        Perform double parameter substitution before logging the message of level WARN according to the format outlined above.
      • warn

        public void warn​(String msg,
                         Throwable t)
        Log a message of level WARN, including an exception.
      • isErrorEnabled

        public boolean isErrorEnabled()
        Are error messages currently enabled?
      • error

        public void error​(String msg)
        A simple implementation which always logs messages of level ERROR according to the format outlined above.
      • error

        public void error​(String format,
                          Object arg)
        Perform single parameter substitution before logging the message of level ERROR according to the format outlined above.
      • error

        public void error​(String format,
                          Object arg1,
                          Object arg2)
        Perform double parameter substitution before logging the message of level ERROR according to the format outlined above.
      • error

        public void error​(String format,
                          Object... argArray)
        Perform double parameter substitution before logging the message of level ERROR according to the format outlined above.
      • error

        public void error​(String msg,
                          Throwable t)
        Log a message of level ERROR, including an exception.
      • getName

        public String getName()
        Specified by:
        getName in interface org.slf4j.Logger