Class FallbackLogger

java.lang.Object
de.iip_ecosphere.platform.configuration.FallbackLogger
All Implemented Interfaces:
org.slf4j.Logger

public class FallbackLogger extends Object implements org.slf4j.Logger
This is a poor man's fallback logger. Why not just a default implementation of SL4J. Because the logging implementation shall only be added during integration (architectural constraint C10), we may end up running the platform instantiator without any logging (as production code and we are not permitted to add a logging implementation). If there is a logging implementation at runtime, fine. If there is none, EASy will not complain about any error, not so good. This is the case for this poor man's logger, which is instantiated and used in the platform instantiator/lifecycle descriptor if there is no logging implementation (and the default one would disable all logging). While it delegates all logging to some rather simple (formatting) function, it completely ignores markers and cause throwables. If somebody needs this, please add. In it's current version, this logger is not intended for reuse, but who knows the future. Public for testing.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • FallbackLogger

      public FallbackLogger(FallbackLogger.LoggingLevel level)
      Creates a logger with logging level.
      Parameters:
      level - the level to use
  • Method Details

    • getLogger

      public static org.slf4j.Logger getLogger(org.slf4j.Logger logger, Class<?> cls, FallbackLogger.LoggingLevel fallbackLevel)
      Creates a logger instance if logger is null. This may be an official one for cls or, if only disabled default loggers are available, a fallback logger with given fallbackLevek.
      Parameters:
      logger - the actual logger, may be null for none
      cls - the class to return an official logger for
      fallbackLevel - if there is no configured official logger, return a fallback logger for the given level
      Returns:
      the new logger instance or logger
    • getName

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

      private void emit(FallbackLogger.LoggingLevel level, String message)
      Emit a message on a given logging level.
      Parameters:
      level - the level
      message - the message
    • emitWithArgs

      private void emitWithArgs(FallbackLogger.LoggingLevel level, String format, Object... arguments)
      Emit a formatted message on a given logging level.
      Parameters:
      level - the level
      format - the message to be formatted
      arguments - the arguments
    • isTraceEnabled

      public boolean isTraceEnabled()
      Specified by:
      isTraceEnabled in interface org.slf4j.Logger
    • trace

      public void trace(String msg)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String format, Object arg)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String format, Object arg1, Object arg2)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String format, Object... arguments)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(String msg, Throwable th)
      Specified by:
      trace in interface org.slf4j.Logger
    • isTraceEnabled

      public boolean isTraceEnabled(org.slf4j.Marker marker)
      Specified by:
      isTraceEnabled in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String msg)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String format, Object... argArray)
      Specified by:
      trace in interface org.slf4j.Logger
    • trace

      public void trace(org.slf4j.Marker marker, String msg, Throwable th)
      Specified by:
      trace in interface org.slf4j.Logger
    • isDebugEnabled

      public boolean isDebugEnabled()
      Specified by:
      isDebugEnabled in interface org.slf4j.Logger
    • debug

      public void debug(String msg)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String format, Object arg)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String format, Object arg1, Object arg2)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String format, Object... arguments)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(String msg, Throwable th)
      Specified by:
      debug in interface org.slf4j.Logger
    • isDebugEnabled

      public boolean isDebugEnabled(org.slf4j.Marker marker)
      Specified by:
      isDebugEnabled in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String msg)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String format, Object... arguments)
      Specified by:
      debug in interface org.slf4j.Logger
    • debug

      public void debug(org.slf4j.Marker marker, String msg, Throwable th)
      Specified by:
      debug in interface org.slf4j.Logger
    • isInfoEnabled

      public boolean isInfoEnabled()
      Specified by:
      isInfoEnabled in interface org.slf4j.Logger
    • info

      public void info(String msg)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String format, Object arg)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String format, Object arg1, Object arg2)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String format, Object... arguments)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(String msg, Throwable th)
      Specified by:
      info in interface org.slf4j.Logger
    • isInfoEnabled

      public boolean isInfoEnabled(org.slf4j.Marker marker)
      Specified by:
      isInfoEnabled in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String msg)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String format, Object... arguments)
      Specified by:
      info in interface org.slf4j.Logger
    • info

      public void info(org.slf4j.Marker marker, String msg, Throwable th)
      Specified by:
      info in interface org.slf4j.Logger
    • isWarnEnabled

      public boolean isWarnEnabled()
      Specified by:
      isWarnEnabled in interface org.slf4j.Logger
    • warn

      public void warn(String msg)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String format, Object arg)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String format, Object... arguments)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String format, Object arg1, Object arg2)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(String msg, Throwable th)
      Specified by:
      warn in interface org.slf4j.Logger
    • isWarnEnabled

      public boolean isWarnEnabled(org.slf4j.Marker marker)
      Specified by:
      isWarnEnabled in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String msg)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String format, Object... arguments)
      Specified by:
      warn in interface org.slf4j.Logger
    • warn

      public void warn(org.slf4j.Marker marker, String msg, Throwable th)
      Specified by:
      warn in interface org.slf4j.Logger
    • isErrorEnabled

      public boolean isErrorEnabled()
      Specified by:
      isErrorEnabled in interface org.slf4j.Logger
    • error

      public void error(String msg)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String format, Object arg)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String format, Object arg1, Object arg2)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String format, Object... arguments)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(String msg, Throwable th)
      Specified by:
      error in interface org.slf4j.Logger
    • isErrorEnabled

      public boolean isErrorEnabled(org.slf4j.Marker marker)
      Specified by:
      isErrorEnabled in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String msg)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String format, Object arg)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String format, Object arg1, Object arg2)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String format, Object... arguments)
      Specified by:
      error in interface org.slf4j.Logger
    • error

      public void error(org.slf4j.Marker marker, String msg, Throwable th)
      Specified by:
      error in interface org.slf4j.Logger