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 protectedTimestampedLogFormatter(boolean useColors)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringformat(LogRecord lr)voidformat(LogRecord lr, StringBuilder sb)FormatsLogRecordusing the providedStringBuilder.
This method corresponds toFormatter.format(LogRecord)in a template method pattern.StringtoString()static FormatterwithColorsIfPossible()static FormatterwithoutColors()-
Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
-
-
-
-
Method Detail
-
format
public void format(LogRecord lr, StringBuilder sb)
FormatsLogRecordusing the providedStringBuilder.
This method corresponds toFormatter.format(LogRecord)in a template method pattern. The coloring behaviour is provided by superclass.- Parameters:
lr- theLogRecordto format.sb- theStringBuilderforLogRecordformatting.- See Also:
Formatter.format(LogRecord)
-
withoutColors
public static Formatter withoutColors()
-
withColorsIfPossible
public static Formatter withColorsIfPossible()
-
-