Class FallbackLogger
java.lang.Object
de.iip_ecosphere.platform.configuration.FallbackLogger
- All Implemented Interfaces:
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the basic logging levels in here. -
Field Summary
FieldsFields inherited from interface org.slf4j.Logger
ROOT_LOGGER_NAME -
Constructor Summary
ConstructorsConstructorDescriptionCreates a logger with logging level. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidprivate voidemit(FallbackLogger.LoggingLevel level, String message) Emit a message on a given logging level.private voidemitWithArgs(FallbackLogger.LoggingLevel level, String format, Object... arguments) Emit a formatted message on a given logging level.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidstatic org.slf4j.LoggergetLogger(org.slf4j.Logger logger, Class<?> cls, FallbackLogger.LoggingLevel fallbackLevel) Creates a logger instance ifloggeris null.getName()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidbooleanbooleanisDebugEnabled(org.slf4j.Marker marker) booleanbooleanisErrorEnabled(org.slf4j.Marker marker) booleanbooleanisInfoEnabled(org.slf4j.Marker marker) booleanbooleanisTraceEnabled(org.slf4j.Marker marker) booleanbooleanisWarnEnabled(org.slf4j.Marker marker) voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoid
-
Field Details
-
level
-
-
Constructor Details
-
FallbackLogger
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 ifloggeris null. This may be an official one forclsor, if only disabled default loggers are available, a fallback logger with givenfallbackLevek.- Parameters:
logger- the actual logger, may be null for nonecls- the class to return an official logger forfallbackLevel- if there is no configured official logger, return a fallback logger for the given level- Returns:
- the new logger instance or
logger
-
getName
- Specified by:
getNamein interfaceorg.slf4j.Logger
-
emit
Emit a message on a given logging level.- Parameters:
level- the levelmessage- the message
-
emitWithArgs
Emit a formatted message on a given logging level.- Parameters:
level- the levelformat- the message to be formattedarguments- the arguments
-
isTraceEnabled
public boolean isTraceEnabled()- Specified by:
isTraceEnabledin interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
isTraceEnabled
public boolean isTraceEnabled(org.slf4j.Marker marker) - Specified by:
isTraceEnabledin interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
trace
- Specified by:
tracein interfaceorg.slf4j.Logger
-
isDebugEnabled
public boolean isDebugEnabled()- Specified by:
isDebugEnabledin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
isDebugEnabled
public boolean isDebugEnabled(org.slf4j.Marker marker) - Specified by:
isDebugEnabledin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
debug
- Specified by:
debugin interfaceorg.slf4j.Logger
-
isInfoEnabled
public boolean isInfoEnabled()- Specified by:
isInfoEnabledin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
isInfoEnabled
public boolean isInfoEnabled(org.slf4j.Marker marker) - Specified by:
isInfoEnabledin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
info
- Specified by:
infoin interfaceorg.slf4j.Logger
-
isWarnEnabled
public boolean isWarnEnabled()- Specified by:
isWarnEnabledin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
isWarnEnabled
public boolean isWarnEnabled(org.slf4j.Marker marker) - Specified by:
isWarnEnabledin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
warn
- Specified by:
warnin interfaceorg.slf4j.Logger
-
isErrorEnabled
public boolean isErrorEnabled()- Specified by:
isErrorEnabledin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
isErrorEnabled
public boolean isErrorEnabled(org.slf4j.Marker marker) - Specified by:
isErrorEnabledin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-
error
- Specified by:
errorin interfaceorg.slf4j.Logger
-