Class LogReporter.Options.Builder
java.lang.Object
io.jstach.rainbowgum.LogReporter.Options.Builder
- Enclosing class:
LogReporter.Options
Builds
LogReporter.Options.-
Method Summary
Modifier and TypeMethodDescriptionalertFormatter(LogFormatter alertFormatter) Formatter used to render each alert entry whenLogReporter.Section.ALERTSis included.build()Builds the options.loggerLevels(boolean loggerLevels) Whether to resolve and print each logger's level, viaLogConfig.levelResolver(), next to its name whenLogReporter.Section.LOGGERSis included.maxAlerts(int maxAlerts) Maximum number of most recent alerts to print whenLogReporter.Section.ALERTSis included.section(LogReporter.Section section) Adds a single section to print, in addition to any already added.sections(Set<LogReporter.Section> sections) Replaces the set of sections to print.
-
Method Details
-
sections
Replaces the set of sections to print. An empty set is treated the same as never calling this method at all: the default sections (LogReporter.Section.VERSION,LogReporter.Section.COMPONENTS) are used.- Parameters:
sections- sections to print.- Returns:
- this.
-
section
Adds a single section to print, in addition to any already added.- Parameters:
section- section to print.- Returns:
- this.
-
maxAlerts
Maximum number of most recent alerts to print whenLogReporter.Section.ALERTSis included. Oldest-first entries beyond this count are omitted, not truncated mid list. Default is 5.- Parameters:
maxAlerts- maximum alerts to print, zero or greater.- Returns:
- this.
-
alertFormatter
Formatter used to render each alert entry whenLogReporter.Section.ALERTSis included. Alerts are justLogEvents (seeLogAlerts.dump()), so anyLogFormatterworks here, e.g. one that omits the timestamp for a deterministic report. Default prints[timestamp] LEVEL loggerName - message.- Parameters:
alertFormatter- formatter for a single alert.- Returns:
- this.
-
loggerLevels
Whether to resolve and print each logger's level, viaLogConfig.levelResolver(), next to its name whenLogReporter.Section.LOGGERSis included. Default istrue.- Parameters:
loggerLevels- false to print just the bare logger names.- Returns:
- this.
-
build
Builds the options. With no sections added the default sections (LogReporter.Section.VERSION,LogReporter.Section.COMPONENTS) are used.- Returns:
- options.
-