Package io.github.qishr.cascara.common.diagnostic.format
Class PlainLogFormatter
java.lang.Object
io.github.qishr.cascara.common.diagnostic.format.PlainLogFormatter
All Implemented Interfaces:
LogFormatter
Direct Known Subtypes:
ColoredLogFormatter
public class PlainLogFormatter
Field Summary
| Modifier and Type | Field | Description |
|---|---|---|
| protected static final DateTimeFormatter | TIME_FORMAT | |
| protected static final ZoneId | UTC | |
| protected FormatOptions | options | |
| protected long | processId |
Constructor Summary
| Constructor | Description |
|---|---|
| PlainLogFormatter(FormatOptions options) |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
| public PlainLogFormatter | withFields(Set<Field> fields) | |
| public LogFormatter | setOptions(FormatOptions options) | |
| public String | format(Diagnostic diagnostic) | |
| protected void | formatLine(StringBuilder sb, Diagnostic diagnostic, String msgLine, int msgLineNumber) | |
| public String | formatStackTrace(Level level, StackTraceElement[] stackTrace, Throwable t) |
Field Details
TIME_FORMAT
protected static final DateTimeFormatter TIME_FORMAT
UTC
protected static final ZoneId UTC
options
protected FormatOptions options
processId
protected long processId
Method Details
withFields
public PlainLogFormatter withFields(Set<Field> fields)
Specified By:
setOptions
public LogFormatter setOptions(FormatOptions options)
Specified By:
format
public String format(Diagnostic diagnostic)
Specified By:
formatLine
protected void formatLine(StringBuilder sb, Diagnostic diagnostic, String msgLine, int msgLineNumber)
formatStackTrace
public String formatStackTrace(Level level, StackTraceElement[] stackTrace, Throwable t)
Specified By: