public class DefaultLoggerFormatter extends Object implements LoggerFormatter
LoggerFormatter.| Modifier and Type | Field and Description |
|---|---|
static DefaultLoggerFormatter |
INSTANCE |
| Constructor and Description |
|---|
DefaultLoggerFormatter() |
| Modifier and Type | Method and Description |
|---|---|
String |
format(Level logLevel,
String message,
Throwable throwable)
Formats the inputs into a string that will be printed.
|
protected String |
logLevel(Level level)
Converts the log level enum to its string representation.
|
protected String |
timestamp()
Returns a timestamp to be included in the default output log format.
|
public static final DefaultLoggerFormatter INSTANCE
public String format(Level logLevel, String message, @Nullable Throwable throwable)
LoggerFormatterformat in interface LoggerFormatterlogLevel - the log level.message - the message.throwable - the throwable, which can be null.protected String timestamp()
protected String logLevel(Level level)
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.
level - the level to convert.Copyright © 2024 Couchbase, Inc.. All rights reserved.