- All Superinterfaces:
LogFormatter
- All Known Implementing Classes:
LogFormatter.NoopFormatter
- Enclosing interface:
LogFormatter
public static sealed interface LogFormatter.LevelFormatter
extends LogFormatter
permits LogFormatter.NoopFormatter (not exhaustive)
Formats a
System.Logger.Level
.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jstach.rainbowgum.LogFormatter
LogFormatter.Builder, LogFormatter.EventFormatter, LogFormatter.LevelFormatter, LogFormatter.NoopFormatter, LogFormatter.StaticFormatter, LogFormatter.ThrowableFormatter, LogFormatter.TimestampFormatter
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
format
(StringBuilder output, LogEvent event) Formats a log event.void
formatLevel
(StringBuilder output, System.Logger.Level level) Formats the level.default String
formatLevel
(System.Logger.Level level) Formats a level.static LogFormatter.LevelFormatter
of()
Default implementation callstoString(Level)
static LogFormatter.LevelFormatter
Default implementation callsrightPadded(Level)
static String
rightPadded
(System.Logger.Level level) Turns a Level into a SLF4J like level String that is all upper case and same length with right padding.static String
toString
(System.Logger.Level level) Turns a Level into a SLF4J like level String that is all upper case.Methods inherited from interface io.jstach.rainbowgum.LogFormatter
isNoop
-
Method Details
-
formatLevel
Formats the level.- Parameters:
output
- buffer.level
- level.
-
format
Description copied from interface:LogFormatter
Formats a log event.- Specified by:
format
in interfaceLogFormatter
- Parameters:
output
- buffer.event
- log event.- See Also:
-
formatLevel
Formats a level.- Parameters:
level
- level- Returns:
- formatted level as a string.
-
of
Default implementation callstoString(Level)
- Returns:
- formatter.
-
ofRightPadded
Default implementation callsrightPadded(Level)
- Returns:
- formatter.
-
toString
Turns a Level into a SLF4J like level String that is all upper case.System.Logger.Level.ALL
is "TRACE
",System.Logger.Level.OFF
is "ERROR
" andSystem.Logger.Level.WARNING
is "WARN
".- Parameters:
level
- system logger level.- Returns:
- upper case string of level.
-
rightPadded
Turns a Level into a SLF4J like level String that is all upper case and same length with right padding.System.Logger.Level.ALL
is "TRACE
",System.Logger.Level.OFF
is "ERROR
" andSystem.Logger.Level.WARNING
is "WARN
".- Parameters:
level
- system logger level.- Returns:
- upper case string of level.
-