Package com.couchbase.client.core.cnc
Class DefaultLoggerFormatter
java.lang.Object
com.couchbase.client.core.cnc.DefaultLoggerFormatter
- All Implemented Interfaces:
LoggerFormatter
The default implementation for the
LoggerFormatter
.-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
DefaultLoggerFormatter
public DefaultLoggerFormatter()
-
-
Method Details
-
format
Description copied from interface:LoggerFormatter
Formats the inputs into a string that will be printed.- Specified by:
format
in interfaceLoggerFormatter
- Parameters:
logLevel
- the log level.message
- the message.throwable
- the throwable, which can be null.- Returns:
- the formatted string that will be printed onto the console.
-
timestamp
Returns a timestamp to be included in the default output log format.- Returns:
- a timestamp or date format, might be null or empty.
-
logLevel
Converts the log level enum to its string representation.Note that in the default implementation, the aim is to preserve the length of the log levels so some levels are prefixed with whitespace - this is not a typo.
- Parameters:
level
- the level to convert.- Returns:
- the converted level.
-