java.lang.Object
org.seppiko.commons.logging.event.DefaultLogging
- All Implemented Interfaces:
Logging
Default logging implementation
- Author:
- Leonard Woo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intcurrent log level.protected static final StringThe default format to use when formatting datesFields inherited from interface org.seppiko.commons.logging.Logging
LEVEL_DEBUG_INT, LEVEL_ERROR_INT, LEVEL_FATAL_INT, LEVEL_INFO_INT, LEVEL_TRACE_INT, LEVEL_WARN_INT -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorDefaultLogging(String loggingName) constructor with logging name -
Method Summary
Modifier and TypeMethodDescriptionatDebug()Level DEBUGatError()Level ERRORatFatal()Level FATALatInfo()Level INFOatTrace()Level TRACEatWarn()Level WARNvoiddebug(CharSequence message) Logs a message with the DEBUG level.voiddebug(CharSequence message, Throwable cause) Logs a message at the DEBUG level including the stack trace of the Throwable.voiddebug(CharSequence message, Throwable cause, Supplier<?>... paramsSupplier) Logs a message at the DEBUG level with parameters, including the stack trace of the Throwable.voiderror(CharSequence message) Logs a message with the ERROR level.voiderror(CharSequence message, Throwable cause) Logs a message at the ERROR level including the stack trace of the Throwable.voiderror(CharSequence message, Throwable cause, Supplier<?>... paramsSupplier) Logs a message at the ERROR level with parameters, including the stack trace of the Throwable.voidfatal(CharSequence message) Logs a message with the FATAL level.voidfatal(CharSequence message, Throwable cause) Logs a message at the FATAL level including the stack trace of the Throwable.voidfatal(CharSequence message, Throwable cause, Supplier<?>... paramsSupplier) Logs a message at the FATAL level with parameters, including the stack trace of the Throwable.getName()Get logging namevoidinfo(CharSequence message) Logs a message with the INFO level.voidinfo(CharSequence message, Throwable cause) Logs a message at the INFO level including the stack trace of the Throwable.voidinfo(CharSequence message, Throwable cause, Supplier<?>... paramsSupplier) Logs a message at the INFO level with parameters, including the stack trace of the Throwable.booleanChecks whether this Logger is enabled for the DEBUG level.booleanisEnable(int level) Checks whether this Logger is enabled for the given Level.booleanChecks whether this Logger is enabled for the ERROR level.booleanChecks whether this Logger is enabled for the FATAL level.booleanChecks whether this Logger is enabled for the INFO level.booleanChecks whether this Logger is enabled for the TRACE level.booleanChecks whether this Logger is enabled for the WARN level.voidlog(int level, CharSequence message) Logs a message with the specific Marker at the given level.voidlog(int level, CharSequence message, Throwable cause) Logs a message with the specific Marker at the given level.voidlog(int level, CharSequence message, Throwable cause, Object... params) Logs a message with the specific Marker at the given level.voidlog(int level, CharSequence message, Throwable cause, Supplier<?>... paramSuppliers) Logs a message with the specific Marker at the given level.voidsetDelegate(Logging logging) set delegate loggingvoidtrace(CharSequence message) Logs a message with the TRACE level.voidtrace(CharSequence message, Throwable cause) Logs a message at the TRACE level including the stack trace of the Throwable.voidtrace(CharSequence message, Throwable cause, Supplier<?>... paramsSupplier) Logs a message at the TRACE level with parameters, including the stack trace of the Throwable.voidwarn(CharSequence message) Logs a message with the WARN level.voidwarn(CharSequence message, Throwable cause) Logs a message at the WARN level including the stack trace of the Throwable.voidwarn(CharSequence message, Throwable cause, Supplier<?>... paramsSupplier) Logs a message at the WARN level with parameters, including the stack trace of the Throwable.
-
Field Details
-
DEFAULT_DATE_TIME_FORMAT
The default format to use when formatting dates- See Also:
-
currentLogLevel
protected volatile int currentLogLevelcurrent log level.
-
-
Constructor Details
-
DefaultLogging
public DefaultLogging()Default constructor -
DefaultLogging
constructor with logging name- Parameters:
loggingName- logging name.
-
-
Method Details
-
setDelegate
set delegate logging- Parameters:
logging- delegate logging.
-
getName
Get logging name -
isEnable
public boolean isEnable(int level) Checks whether this Logger is enabled for the given Level. -
log
Logs a message with the specific Marker at the given level. -
log
Logs a message with the specific Marker at the given level. -
log
Logs a message with the specific Marker at the given level. -
log
Logs a message with the specific Marker at the given level. -
isTraceEnable
public boolean isTraceEnable()Checks whether this Logger is enabled for the TRACE level.- Specified by:
isTraceEnablein interfaceLogging- Returns:
- true if this Logger is enabled for level TRACE, false otherwise.
-
trace
Logs a message with the TRACE level. -
trace
Logs a message at the TRACE level including the stack trace of the Throwable. -
trace
Logs a message at the TRACE level with parameters, including the stack trace of the Throwable. -
atTrace
Level TRACE- Specified by:
atTracein interfaceLogging- Returns:
- a new
LoggingBuilderinstance as appropriate for this log.
-
isDebugEnable
public boolean isDebugEnable()Checks whether this Logger is enabled for the DEBUG level.- Specified by:
isDebugEnablein interfaceLogging- Returns:
- true if this Logger is enabled for level DEBUG, false otherwise.
-
debug
Logs a message with the DEBUG level. -
debug
Logs a message at the DEBUG level including the stack trace of the Throwable. -
debug
Logs a message at the DEBUG level with parameters, including the stack trace of the Throwable. -
atDebug
Level DEBUG- Specified by:
atDebugin interfaceLogging- Returns:
- a new
LoggingBuilderinstance as appropriate for this log.
-
isInfoEnable
public boolean isInfoEnable()Checks whether this Logger is enabled for the INFO level.- Specified by:
isInfoEnablein interfaceLogging- Returns:
- true if this Logger is enabled for level INFO, false otherwise.
-
info
Logs a message with the INFO level. -
info
Logs a message at the INFO level including the stack trace of the Throwable. throwable passed as parameter. -
info
Logs a message at the INFO level with parameters, including the stack trace of the Throwable. -
atInfo
Level INFO- Specified by:
atInfoin interfaceLogging- Returns:
- a new
LoggingBuilderinstance as appropriate for this log.
-
isWarnEnable
public boolean isWarnEnable()Checks whether this Logger is enabled for the WARN level.- Specified by:
isWarnEnablein interfaceLogging- Returns:
- true if this Logger is enabled for level WARN, false otherwise.
-
warn
Logs a message with the WARN level. -
warn
Logs a message at the WARN level including the stack trace of the Throwable. throwable passed as parameter. -
warn
Logs a message at the WARN level with parameters, including the stack trace of the Throwable. -
atWarn
Level WARN- Specified by:
atWarnin interfaceLogging- Returns:
- a new
LoggingBuilderinstance as appropriate for this log.
-
isErrorEnable
public boolean isErrorEnable()Checks whether this Logger is enabled for the ERROR level.- Specified by:
isErrorEnablein interfaceLogging- Returns:
- true if this Logger is enabled for level ERROR, false otherwise.
-
error
Logs a message with the ERROR level. -
error
Logs a message at the ERROR level including the stack trace of the Throwable. throwable passed as parameter. -
error
Logs a message at the ERROR level with parameters, including the stack trace of the Throwable. -
atError
Level ERROR- Specified by:
atErrorin interfaceLogging- Returns:
- a new
LoggingBuilderinstance as appropriate for this log.
-
isFatalEnable
public boolean isFatalEnable()Checks whether this Logger is enabled for the FATAL level.- Specified by:
isFatalEnablein interfaceLogging- Returns:
- true if this Logger is enabled for level FATAL, false otherwise.
-
fatal
Logs a message with the FATAL level. -
fatal
Logs a message at the FATAL level including the stack trace of the Throwable. throwable passed as parameter. -
fatal
Logs a message at the FATAL level with parameters, including the stack trace of the Throwable. -
atFatal
Level FATAL- Specified by:
atFatalin interfaceLogging- Returns:
- a new
LoggingBuilderinstance as appropriate for this log.
-