21 package org.sleuthkit.autopsy.coreutils;
23 import java.text.DateFormat;
24 import java.util.Date;
25 import java.util.Locale;
26 import java.util.logging.Formatter;
27 import java.util.logging.LogRecord;
33 class TimestampingFormatter
extends Formatter {
36 DateFormat timestampFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, Locale.US);
37 String lineSeparator = System.getProperty(
"line.separator");
39 TimestampingFormatter(Formatter original) {
40 this.original = original;
44 public String format(LogRecord record) {
45 long millis = record.getMillis();
46 String timestamp = timestampFormat.format(
new Date(millis));
48 return timestamp + lineSeparator + original.format(record);