Package org.refcodes.logger.alt.slf4j
Class Slf4jRuntimeLogger
- java.lang.Object
-
- org.refcodes.logger.alt.slf4j.Slf4jRuntimeLogger
-
- All Implemented Interfaces:
org.refcodes.logger.LogPriorityAccessor
,org.refcodes.logger.MessageLogger<org.refcodes.logger.LogPriority>
,org.refcodes.logger.RuntimeLogger
,org.refcodes.mixin.NameAccessor
,org.refcodes.mixin.NameAccessor.NameMutator
,org.refcodes.mixin.NameAccessor.NameProperty
public class Slf4jRuntimeLogger extends java.lang.Object implements org.refcodes.logger.RuntimeLogger, org.refcodes.mixin.NameAccessor.NameProperty
Alternate implementation of theRuntimeLogger
to log using SLF4J.
-
-
Constructor Summary
Constructors Constructor Description Slf4jRuntimeLogger()
In case theSlf4jRuntimeLogger
(as created by theSlf4jRuntimeLoggerFactorySingleton
) detects that SLF4J has bound a SLF4JRuntimeLoggerAdapterImpl
(seerefcodes-logger-ext-slf4j
, the REFCODES.ORG SLF4J binding) (i.e. the REFCODES.ORG SLF4J binding), it directly delegates its method calls to the wrappedRuntimeLogger
instead of marshaling a log request through the SLF4JRuntimeLoggerAdapterImpl
; as marshaling would mean consolidating of various detailedLogPriority
levels to a single SLF4J log level.Slf4jRuntimeLogger(org.slf4j.Logger aLogger)
In case theSlf4jRuntimeLogger
(as created by theSlf4jRuntimeLoggerFactorySingleton
) detects that SLF4J has bound a SLF4JRuntimeLoggerAdapterImpl
(seerefcodes-logger-ext-slf4j
, the REFCODES.ORG SLF4J binding), it directly delegates its method calls to the wrappedRuntimeLogger
instead of marshaling a log request through the SLF4JRuntimeLoggerAdapterImpl
as marshaling would mean consolidating of various detailedLogPriority
levels to a single SLF4J log level.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
alert(java.lang.String aMessage)
void
alert(java.lang.String aMessage, java.lang.Object... aArguments)
void
alert(java.lang.String aMessage, java.lang.Throwable aThrowable)
void
alert(java.lang.String aMessage, java.lang.Throwable aThrowable, java.lang.Object... aArguments)
void
critical(java.lang.String aMessage)
void
critical(java.lang.String aMessage, java.lang.Object... aArguments)
void
critical(java.lang.String aMessage, java.lang.Throwable aThrowable)
void
critical(java.lang.String aMessage, java.lang.Throwable aThrowable, java.lang.Object... aArguments)
void
debug(java.lang.String aMessage)
void
debug(java.lang.String aMessage, java.lang.Object... aArguments)
void
error(java.lang.String aMessage)
void
error(java.lang.String aMessage, java.lang.Object... aArguments)
void
error(java.lang.String aMessage, java.lang.Throwable aThrowable)
void
error(java.lang.String aMessage, java.lang.Throwable aThrowable, java.lang.Object... aArguments)
org.refcodes.logger.LogPriority
getLogPriority()
java.lang.String
getName()
void
info(java.lang.String aMessage)
void
info(java.lang.String aMessage, java.lang.Object... aArguments)
boolean
isLog(org.refcodes.logger.LogPriority aPriority)
boolean
isLogAlert()
boolean
isLogCritical()
boolean
isLogDebug()
boolean
isLogError()
boolean
isLogInfo()
boolean
isLogNotice()
boolean
isLogPanic()
boolean
isLogTrace()
boolean
isLogWarn()
void
log(org.refcodes.logger.LogPriority aPriority, java.lang.String aMessage)
void
log(org.refcodes.logger.LogPriority aPriority, java.lang.String aMessage, java.lang.Object... aArguments)
void
log(org.refcodes.logger.LogPriority aPriority, java.lang.String aMessage, java.lang.Throwable aThrowable)
void
log(org.refcodes.logger.LogPriority aPriority, java.lang.String aMessage, java.lang.Throwable aThrowable, java.lang.Object... aArguments)
void
notice(java.lang.String aMessage)
void
notice(java.lang.String aMessage, java.lang.Object... aArguments)
void
panic(java.lang.String aMessage)
void
panic(java.lang.String aMessage, java.lang.Object... aArguments)
void
panic(java.lang.String aMessage, java.lang.Throwable aThrowable)
void
panic(java.lang.String aMessage, java.lang.Throwable aThrowable, java.lang.Object... aArguments)
void
setName(java.lang.String aName)
void
trace(java.lang.String aMessage)
void
trace(java.lang.String aMessage, java.lang.Object... aArguments)
void
warn(java.lang.String aMessage)
void
warn(java.lang.String aMessage, java.lang.Object... aArguments)
void
warn(java.lang.String aMessage, java.lang.Throwable aThrowable)
void
warn(java.lang.String aMessage, java.lang.Throwable aThrowable, java.lang.Object... aArguments)
-
-
-
Constructor Detail
-
Slf4jRuntimeLogger
public Slf4jRuntimeLogger()
In case theSlf4jRuntimeLogger
(as created by theSlf4jRuntimeLoggerFactorySingleton
) detects that SLF4J has bound a SLF4JRuntimeLoggerAdapterImpl
(seerefcodes-logger-ext-slf4j
, the REFCODES.ORG SLF4J binding) (i.e. the REFCODES.ORG SLF4J binding), it directly delegates its method calls to the wrappedRuntimeLogger
instead of marshaling a log request through the SLF4JRuntimeLoggerAdapterImpl
; as marshaling would mean consolidating of various detailedLogPriority
levels to a single SLF4J log level.
-
Slf4jRuntimeLogger
public Slf4jRuntimeLogger(org.slf4j.Logger aLogger)
In case theSlf4jRuntimeLogger
(as created by theSlf4jRuntimeLoggerFactorySingleton
) detects that SLF4J has bound a SLF4JRuntimeLoggerAdapterImpl
(seerefcodes-logger-ext-slf4j
, the REFCODES.ORG SLF4J binding), it directly delegates its method calls to the wrappedRuntimeLogger
instead of marshaling a log request through the SLF4JRuntimeLoggerAdapterImpl
as marshaling would mean consolidating of various detailedLogPriority
levels to a single SLF4J log level.- Parameters:
aLogger
- the logger to use SLF4J for logging.
-
-
Method Detail
-
log
public void log(org.refcodes.logger.LogPriority aPriority, java.lang.String aMessage)
- Specified by:
log
in interfaceorg.refcodes.logger.MessageLogger<org.refcodes.logger.LogPriority>
-
log
public void log(org.refcodes.logger.LogPriority aPriority, java.lang.String aMessage, java.lang.Object... aArguments)
- Specified by:
log
in interfaceorg.refcodes.logger.MessageLogger<org.refcodes.logger.LogPriority>
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceorg.refcodes.mixin.NameAccessor
-
setName
public void setName(java.lang.String aName)
- Specified by:
setName
in interfaceorg.refcodes.mixin.NameAccessor.NameMutator
-
getLogPriority
public org.refcodes.logger.LogPriority getLogPriority()
- Specified by:
getLogPriority
in interfaceorg.refcodes.logger.LogPriorityAccessor
-
log
public void log(org.refcodes.logger.LogPriority aPriority, java.lang.String aMessage, java.lang.Throwable aThrowable)
- Specified by:
log
in interfaceorg.refcodes.logger.RuntimeLogger
-
log
public void log(org.refcodes.logger.LogPriority aPriority, java.lang.String aMessage, java.lang.Throwable aThrowable, java.lang.Object... aArguments)
- Specified by:
log
in interfaceorg.refcodes.logger.RuntimeLogger
-
isLog
public boolean isLog(org.refcodes.logger.LogPriority aPriority)
- Specified by:
isLog
in interfaceorg.refcodes.logger.RuntimeLogger
-
trace
public void trace(java.lang.String aMessage)
- Specified by:
trace
in interfaceorg.refcodes.logger.RuntimeLogger
-
trace
public void trace(java.lang.String aMessage, java.lang.Object... aArguments)
- Specified by:
trace
in interfaceorg.refcodes.logger.RuntimeLogger
-
isLogTrace
public boolean isLogTrace()
- Specified by:
isLogTrace
in interfaceorg.refcodes.logger.RuntimeLogger
-
debug
public void debug(java.lang.String aMessage)
- Specified by:
debug
in interfaceorg.refcodes.logger.RuntimeLogger
-
debug
public void debug(java.lang.String aMessage, java.lang.Object... aArguments)
- Specified by:
debug
in interfaceorg.refcodes.logger.RuntimeLogger
-
isLogDebug
public boolean isLogDebug()
- Specified by:
isLogDebug
in interfaceorg.refcodes.logger.RuntimeLogger
-
info
public void info(java.lang.String aMessage)
- Specified by:
info
in interfaceorg.refcodes.logger.RuntimeLogger
-
info
public void info(java.lang.String aMessage, java.lang.Object... aArguments)
- Specified by:
info
in interfaceorg.refcodes.logger.RuntimeLogger
-
isLogInfo
public boolean isLogInfo()
- Specified by:
isLogInfo
in interfaceorg.refcodes.logger.RuntimeLogger
-
notice
public void notice(java.lang.String aMessage)
- Specified by:
notice
in interfaceorg.refcodes.logger.RuntimeLogger
-
notice
public void notice(java.lang.String aMessage, java.lang.Object... aArguments)
- Specified by:
notice
in interfaceorg.refcodes.logger.RuntimeLogger
-
isLogNotice
public boolean isLogNotice()
- Specified by:
isLogNotice
in interfaceorg.refcodes.logger.RuntimeLogger
-
warn
public void warn(java.lang.String aMessage)
- Specified by:
warn
in interfaceorg.refcodes.logger.RuntimeLogger
-
warn
public void warn(java.lang.String aMessage, java.lang.Object... aArguments)
- Specified by:
warn
in interfaceorg.refcodes.logger.RuntimeLogger
-
warn
public void warn(java.lang.String aMessage, java.lang.Throwable aThrowable)
- Specified by:
warn
in interfaceorg.refcodes.logger.RuntimeLogger
-
warn
public void warn(java.lang.String aMessage, java.lang.Throwable aThrowable, java.lang.Object... aArguments)
- Specified by:
warn
in interfaceorg.refcodes.logger.RuntimeLogger
-
isLogWarn
public boolean isLogWarn()
- Specified by:
isLogWarn
in interfaceorg.refcodes.logger.RuntimeLogger
-
error
public void error(java.lang.String aMessage)
- Specified by:
error
in interfaceorg.refcodes.logger.RuntimeLogger
-
error
public void error(java.lang.String aMessage, java.lang.Object... aArguments)
- Specified by:
error
in interfaceorg.refcodes.logger.RuntimeLogger
-
error
public void error(java.lang.String aMessage, java.lang.Throwable aThrowable)
- Specified by:
error
in interfaceorg.refcodes.logger.RuntimeLogger
-
error
public void error(java.lang.String aMessage, java.lang.Throwable aThrowable, java.lang.Object... aArguments)
- Specified by:
error
in interfaceorg.refcodes.logger.RuntimeLogger
-
isLogError
public boolean isLogError()
- Specified by:
isLogError
in interfaceorg.refcodes.logger.RuntimeLogger
-
critical
public void critical(java.lang.String aMessage)
- Specified by:
critical
in interfaceorg.refcodes.logger.RuntimeLogger
-
critical
public void critical(java.lang.String aMessage, java.lang.Object... aArguments)
- Specified by:
critical
in interfaceorg.refcodes.logger.RuntimeLogger
-
critical
public void critical(java.lang.String aMessage, java.lang.Throwable aThrowable)
- Specified by:
critical
in interfaceorg.refcodes.logger.RuntimeLogger
-
critical
public void critical(java.lang.String aMessage, java.lang.Throwable aThrowable, java.lang.Object... aArguments)
- Specified by:
critical
in interfaceorg.refcodes.logger.RuntimeLogger
-
isLogCritical
public boolean isLogCritical()
- Specified by:
isLogCritical
in interfaceorg.refcodes.logger.RuntimeLogger
-
alert
public void alert(java.lang.String aMessage)
- Specified by:
alert
in interfaceorg.refcodes.logger.RuntimeLogger
-
alert
public void alert(java.lang.String aMessage, java.lang.Object... aArguments)
- Specified by:
alert
in interfaceorg.refcodes.logger.RuntimeLogger
-
alert
public void alert(java.lang.String aMessage, java.lang.Throwable aThrowable)
- Specified by:
alert
in interfaceorg.refcodes.logger.RuntimeLogger
-
alert
public void alert(java.lang.String aMessage, java.lang.Throwable aThrowable, java.lang.Object... aArguments)
- Specified by:
alert
in interfaceorg.refcodes.logger.RuntimeLogger
-
isLogAlert
public boolean isLogAlert()
- Specified by:
isLogAlert
in interfaceorg.refcodes.logger.RuntimeLogger
-
panic
public void panic(java.lang.String aMessage)
- Specified by:
panic
in interfaceorg.refcodes.logger.RuntimeLogger
-
panic
public void panic(java.lang.String aMessage, java.lang.Object... aArguments)
- Specified by:
panic
in interfaceorg.refcodes.logger.RuntimeLogger
-
panic
public void panic(java.lang.String aMessage, java.lang.Throwable aThrowable)
- Specified by:
panic
in interfaceorg.refcodes.logger.RuntimeLogger
-
panic
public void panic(java.lang.String aMessage, java.lang.Throwable aThrowable, java.lang.Object... aArguments)
- Specified by:
panic
in interfaceorg.refcodes.logger.RuntimeLogger
-
isLogPanic
public boolean isLogPanic()
- Specified by:
isLogPanic
in interfaceorg.refcodes.logger.RuntimeLogger
-
-