From 1d0d5661ca921a08217f23d4889f530643327847 Mon Sep 17 00:00:00 2001 From: Leo Sadovsky Date: Thu, 26 Jan 2023 20:34:12 +0300 Subject: worked out the review comments: code formatting and naming issues --- src/main/java/org/traccar/helper/Log.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/main/java/org/traccar/helper') diff --git a/src/main/java/org/traccar/helper/Log.java b/src/main/java/org/traccar/helper/Log.java index a8bf66827..9aaf1cfd3 100644 --- a/src/main/java/org/traccar/helper/Log.java +++ b/src/main/java/org/traccar/helper/Log.java @@ -55,23 +55,21 @@ public final class Log { private String suffix; private Writer writer; private final boolean rotate; - - private final String logFileSuffix; + private final String template; RollingFileHandler(String name, boolean rotate, String rotateInterval) { this.name = name; this.rotate = rotate; - this.logFileSuffix = rotateInterval.equalsIgnoreCase("HOUR") ? "yyyyMMddHH" : "yyyyMMdd"; + this.template = rotateInterval.equalsIgnoreCase("HOUR") ? "yyyyMMddHH" : "yyyyMMdd"; } - @Override public synchronized void publish(LogRecord record) { if (isLoggable(record)) { try { String suffix = ""; if (rotate) { - suffix = new SimpleDateFormat(this.logFileSuffix).format(new Date(record.getMillis())); + suffix = new SimpleDateFormat(template).format(new Date(record.getMillis())); if (writer != null && !suffix.equals(this.suffix)) { writer.close(); writer = null; -- cgit v1.2.3