Package org.sosy_lab.common.log
Class TimestampedLogFormatter
- java.lang.Object
-
- java.util.logging.Formatter
-
- org.sosy_lab.common.log.TimestampedLogFormatter
-
- Direct Known Subclasses:
FileLogFormatter
public class TimestampedLogFormatter extends Formatter
Log formatter that produces output containing a timestamp. Each log message will look like this:timestamp
Level
(component:class.method) message
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TimestampedLogFormatter(boolean useColors)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
format(LogRecord lr)
void
format(LogRecord lr, StringBuilder sb)
FormatsLogRecord
using the providedStringBuilder
.
This method corresponds toFormatter.format(LogRecord)
in a template method pattern.String
toString()
static Formatter
withColorsIfPossible()
static Formatter
withoutColors()
-
Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
-
-
-
-
Method Detail
-
format
public void format(LogRecord lr, StringBuilder sb)
FormatsLogRecord
using the providedStringBuilder
.
This method corresponds toFormatter.format(LogRecord)
in a template method pattern. The coloring behaviour is provided by superclass.- Parameters:
lr
- theLogRecord
to format.sb
- theStringBuilder
forLogRecord
formatting.- See Also:
Formatter.format(LogRecord)
-
withoutColors
public static Formatter withoutColors()
-
withColorsIfPossible
public static Formatter withColorsIfPossible()
-
-