From 27801dccf53dacb5ca3a59a0c4d23bf3f601157d Mon Sep 17 00:00:00 2001 From: q3769 Date: Sat, 23 Sep 2023 22:54:57 -0500 Subject: [PATCH] + conseq4j version bump + dsl-json version bump --- pom.xml | 4 ++-- .../java/elf4j/engine/service/EventingLogService.java | 6 ------ .../java/elf4j/engine/service/pattern/ClassPattern.java | 7 +------ .../elf4j/engine/service/pattern/FileNamePattern.java | 7 +------ .../java/elf4j/engine/service/pattern/JsonPattern.java | 7 +------ .../java/elf4j/engine/service/pattern/LevelPattern.java | 7 +------ .../elf4j/engine/service/pattern/LineNumberPattern.java | 7 +------ .../service/pattern/MessageAndExceptionPattern.java | 7 +------ .../java/elf4j/engine/service/pattern/MethodPattern.java | 7 +------ .../java/elf4j/engine/service/pattern/PatternGroup.java | 5 ----- .../engine/service/pattern/SystemEnvironmentPattern.java | 7 +------ .../engine/service/pattern/SystemPropertyPattern.java | 7 +------ .../java/elf4j/engine/service/pattern/ThreadPattern.java | 7 +------ .../elf4j/engine/service/pattern/TimestampPattern.java | 7 +------ .../elf4j/engine/service/pattern/VerbatimPattern.java | 7 +------ .../elf4j/engine/service/writer/ConseqWriterGroup.java | 9 --------- .../engine/service/writer/PerformanceSensitive.java | 5 ----- .../engine/service/writer/StandardStreamsWriter.java | 5 ----- .../elf4j/engine/service/pattern/JsonPatternTest.java | 6 +----- 19 files changed, 15 insertions(+), 109 deletions(-) diff --git a/pom.xml b/pom.xml index 77f657f..735a845 100644 --- a/pom.xml +++ b/pom.xml @@ -81,8 +81,8 @@ com.dslplatform - dsl-json-java8 - 1.10.0 + dsl-json + 2.0.2 org.projectlombok diff --git a/src/main/java/elf4j/engine/service/EventingLogService.java b/src/main/java/elf4j/engine/service/EventingLogService.java index 05d2d82..63e8982 100644 --- a/src/main/java/elf4j/engine/service/EventingLogService.java +++ b/src/main/java/elf4j/engine/service/EventingLogService.java @@ -53,11 +53,6 @@ public boolean includeCallerDetail() { return this.logServiceConfiguration.getLogServiceWriter().includeCallerDetail(); } - @Override - public boolean includeCallerThread() { - return this.logServiceConfiguration.getLogServiceWriter().includeCallerThread(); - } - @Override public boolean isEnabled(NativeLogger nativeLogger) { return logServiceConfiguration.isEnabled(nativeLogger); @@ -85,4 +80,3 @@ public void log(@NonNull NativeLogger nativeLogger, this.logServiceConfiguration.getLogEventProcessor().process(logEventBuilder.build()); } } - diff --git a/src/main/java/elf4j/engine/service/pattern/ClassPattern.java b/src/main/java/elf4j/engine/service/pattern/ClassPattern.java index 41d6886..8033f64 100644 --- a/src/main/java/elf4j/engine/service/pattern/ClassPattern.java +++ b/src/main/java/elf4j/engine/service/pattern/ClassPattern.java @@ -35,7 +35,7 @@ * */ @Value -public class ClassPattern implements LogPattern { +class ClassPattern implements LogPattern { private static final DisplayOption DEFAULT_DISPLAY_OPTION = DisplayOption.SIMPLE; @NonNull DisplayOption classDisplayOption; @@ -64,11 +64,6 @@ public boolean includeCallerDetail() { return false; } - @Override - public boolean includeCallerThread() { - return false; - } - @Override public void render(@NonNull LogEvent logEvent, StringBuilder target) { String fullName = logEvent.getCallerClassName(); diff --git a/src/main/java/elf4j/engine/service/pattern/FileNamePattern.java b/src/main/java/elf4j/engine/service/pattern/FileNamePattern.java index fbea23a..08ab17b 100644 --- a/src/main/java/elf4j/engine/service/pattern/FileNamePattern.java +++ b/src/main/java/elf4j/engine/service/pattern/FileNamePattern.java @@ -35,7 +35,7 @@ * */ @Value -public class FileNamePattern implements LogPattern { +class FileNamePattern implements LogPattern { /** * @param patternSegment * text segment to convert @@ -54,11 +54,6 @@ public boolean includeCallerDetail() { return true; } - @Override - public boolean includeCallerThread() { - return false; - } - @Override public void render(@NonNull LogEvent logEvent, @NonNull StringBuilder target) { target.append(logEvent.getCallerDetail().getFileName()); diff --git a/src/main/java/elf4j/engine/service/pattern/JsonPattern.java b/src/main/java/elf4j/engine/service/pattern/JsonPattern.java index 6e12d1f..0140f4e 100644 --- a/src/main/java/elf4j/engine/service/pattern/JsonPattern.java +++ b/src/main/java/elf4j/engine/service/pattern/JsonPattern.java @@ -53,7 +53,7 @@ */ @Value @Builder -public class JsonPattern implements LogPattern { +class JsonPattern implements LogPattern { private static final String UTF_8 = StandardCharsets.UTF_8.toString(); private static final int JSON_BYTES_INIT_SIZE = 1024; private static final String CALLER_DETAIL = "caller-detail"; @@ -97,11 +97,6 @@ public boolean includeCallerDetail() { return this.includeCallerDetail; } - @Override - public boolean includeCallerThread() { - return this.includeCallerThread; - } - @Override public void render(LogEvent logEvent, @NonNull StringBuilder target) { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(JSON_BYTES_INIT_SIZE); diff --git a/src/main/java/elf4j/engine/service/pattern/LevelPattern.java b/src/main/java/elf4j/engine/service/pattern/LevelPattern.java index ff5ca00..773c244 100644 --- a/src/main/java/elf4j/engine/service/pattern/LevelPattern.java +++ b/src/main/java/elf4j/engine/service/pattern/LevelPattern.java @@ -35,7 +35,7 @@ * */ @Value -public class LevelPattern implements LogPattern { +class LevelPattern implements LogPattern { private static final int UNSPECIFIED = -1; int displayLength; @@ -63,11 +63,6 @@ public boolean includeCallerDetail() { return false; } - @Override - public boolean includeCallerThread() { - return false; - } - @Override public void render(@NonNull LogEvent logEvent, StringBuilder target) { String level = logEvent.getNativeLogger().getLevel().name(); diff --git a/src/main/java/elf4j/engine/service/pattern/LineNumberPattern.java b/src/main/java/elf4j/engine/service/pattern/LineNumberPattern.java index 1f92a37..4bc5c44 100644 --- a/src/main/java/elf4j/engine/service/pattern/LineNumberPattern.java +++ b/src/main/java/elf4j/engine/service/pattern/LineNumberPattern.java @@ -35,7 +35,7 @@ * */ @Value -public class LineNumberPattern implements LogPattern { +class LineNumberPattern implements LogPattern { /** * @param patternSegment * text segment to convert @@ -54,11 +54,6 @@ public boolean includeCallerDetail() { return true; } - @Override - public boolean includeCallerThread() { - return false; - } - @Override public void render(@NonNull LogEvent logEvent, @NonNull StringBuilder target) { target.append(logEvent.getCallerDetail().getLineNumber()); diff --git a/src/main/java/elf4j/engine/service/pattern/MessageAndExceptionPattern.java b/src/main/java/elf4j/engine/service/pattern/MessageAndExceptionPattern.java index c8de0e6..c402d03 100644 --- a/src/main/java/elf4j/engine/service/pattern/MessageAndExceptionPattern.java +++ b/src/main/java/elf4j/engine/service/pattern/MessageAndExceptionPattern.java @@ -36,7 +36,7 @@ * */ @Value -public class MessageAndExceptionPattern implements LogPattern { +class MessageAndExceptionPattern implements LogPattern { /** * @param patternSegment * text segment to convert @@ -55,11 +55,6 @@ public boolean includeCallerDetail() { return false; } - @Override - public boolean includeCallerThread() { - return false; - } - @Override public void render(@NonNull LogEvent logEvent, @NonNull StringBuilder target) { target.append(logEvent.getResolvedMessage()); diff --git a/src/main/java/elf4j/engine/service/pattern/MethodPattern.java b/src/main/java/elf4j/engine/service/pattern/MethodPattern.java index ef6a318..2316237 100644 --- a/src/main/java/elf4j/engine/service/pattern/MethodPattern.java +++ b/src/main/java/elf4j/engine/service/pattern/MethodPattern.java @@ -35,7 +35,7 @@ * */ @Value -public class MethodPattern implements LogPattern { +class MethodPattern implements LogPattern { /** * @param patternSegment * text segment to convert @@ -54,11 +54,6 @@ public boolean includeCallerDetail() { return true; } - @Override - public boolean includeCallerThread() { - return false; - } - @Override public void render(@NonNull LogEvent logEvent, @NonNull StringBuilder target) { target.append(logEvent.getCallerDetail().getMethodName()); diff --git a/src/main/java/elf4j/engine/service/pattern/PatternGroup.java b/src/main/java/elf4j/engine/service/pattern/PatternGroup.java index 0499cd9..156102b 100644 --- a/src/main/java/elf4j/engine/service/pattern/PatternGroup.java +++ b/src/main/java/elf4j/engine/service/pattern/PatternGroup.java @@ -54,11 +54,6 @@ public boolean includeCallerDetail() { return patterns.stream().anyMatch(LogPattern::includeCallerDetail); } - @Override - public boolean includeCallerThread() { - return patterns.stream().anyMatch(LogPattern::includeCallerThread); - } - @Override public void render(LogEvent logEvent, StringBuilder target) { for (LogPattern pattern : patterns) { diff --git a/src/main/java/elf4j/engine/service/pattern/SystemEnvironmentPattern.java b/src/main/java/elf4j/engine/service/pattern/SystemEnvironmentPattern.java index 2e95e10..e8013e8 100644 --- a/src/main/java/elf4j/engine/service/pattern/SystemEnvironmentPattern.java +++ b/src/main/java/elf4j/engine/service/pattern/SystemEnvironmentPattern.java @@ -35,7 +35,7 @@ * */ @Value -public class SystemEnvironmentPattern implements LogPattern { +class SystemEnvironmentPattern implements LogPattern { String key; String value; @@ -67,9 +67,4 @@ public void render(LogEvent logEvent, StringBuilder target) { public boolean includeCallerDetail() { return false; } - - @Override - public boolean includeCallerThread() { - return false; - } } diff --git a/src/main/java/elf4j/engine/service/pattern/SystemPropertyPattern.java b/src/main/java/elf4j/engine/service/pattern/SystemPropertyPattern.java index 73d4f04..d64c838 100644 --- a/src/main/java/elf4j/engine/service/pattern/SystemPropertyPattern.java +++ b/src/main/java/elf4j/engine/service/pattern/SystemPropertyPattern.java @@ -35,7 +35,7 @@ * */ @Value -public class SystemPropertyPattern implements LogPattern { +class SystemPropertyPattern implements LogPattern { String key; private SystemPropertyPattern(String key) { @@ -65,9 +65,4 @@ public void render(LogEvent logEvent, StringBuilder target) { public boolean includeCallerDetail() { return false; } - - @Override - public boolean includeCallerThread() { - return false; - } } diff --git a/src/main/java/elf4j/engine/service/pattern/ThreadPattern.java b/src/main/java/elf4j/engine/service/pattern/ThreadPattern.java index f9fc833..d135181 100644 --- a/src/main/java/elf4j/engine/service/pattern/ThreadPattern.java +++ b/src/main/java/elf4j/engine/service/pattern/ThreadPattern.java @@ -36,7 +36,7 @@ * */ @Value -public class ThreadPattern implements LogPattern { +class ThreadPattern implements LogPattern { @NonNull ThreadPattern.DisplayOption threadDisplayOption; /** @@ -59,11 +59,6 @@ public boolean includeCallerDetail() { return false; } - @Override - public boolean includeCallerThread() { - return true; - } - @Override public void render(@NonNull LogEvent logEvent, @NonNull StringBuilder target) { LogEvent.ThreadValue callerThread = Objects.requireNonNull(logEvent.getCallerThread()); diff --git a/src/main/java/elf4j/engine/service/pattern/TimestampPattern.java b/src/main/java/elf4j/engine/service/pattern/TimestampPattern.java index 39b903e..b3b6d64 100644 --- a/src/main/java/elf4j/engine/service/pattern/TimestampPattern.java +++ b/src/main/java/elf4j/engine/service/pattern/TimestampPattern.java @@ -38,7 +38,7 @@ * */ @Value -public class TimestampPattern implements LogPattern { +class TimestampPattern implements LogPattern { private static final String DEFAULT_DATETIME_PATTERN = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"; private static final ZoneId DISPLAY_TIME_ZONE = ZoneId.systemDefault(); DateTimeFormatter dateTimeFormatter; @@ -67,11 +67,6 @@ public boolean includeCallerDetail() { return false; } - @Override - public boolean includeCallerThread() { - return false; - } - @Override public void render(@NonNull LogEvent logEvent, @NonNull StringBuilder target) { dateTimeFormatter.formatTo(logEvent.getTimestamp(), target); diff --git a/src/main/java/elf4j/engine/service/pattern/VerbatimPattern.java b/src/main/java/elf4j/engine/service/pattern/VerbatimPattern.java index 1465c82..fe06bd9 100644 --- a/src/main/java/elf4j/engine/service/pattern/VerbatimPattern.java +++ b/src/main/java/elf4j/engine/service/pattern/VerbatimPattern.java @@ -35,7 +35,7 @@ * */ @Value -public class VerbatimPattern implements LogPattern { +class VerbatimPattern implements LogPattern { @NonNull String text; /** @@ -59,11 +59,6 @@ public boolean includeCallerDetail() { return false; } - @Override - public boolean includeCallerThread() { - return false; - } - @Override public void render(LogEvent logEvent, @NonNull StringBuilder target) { target.append(text); diff --git a/src/main/java/elf4j/engine/service/writer/ConseqWriterGroup.java b/src/main/java/elf4j/engine/service/writer/ConseqWriterGroup.java index 9caf7ee..65ce5dc 100644 --- a/src/main/java/elf4j/engine/service/writer/ConseqWriterGroup.java +++ b/src/main/java/elf4j/engine/service/writer/ConseqWriterGroup.java @@ -54,7 +54,6 @@ public class ConseqWriterGroup implements LogWriter, Stoppable { private final ConseqExecutor conseqExecutor; private Level minimumLevel; @ToString.Exclude private Boolean includeCallerDetail; - @ToString.Exclude private Boolean includeCallerThread; private ConseqWriterGroup(List writers, ConseqExecutor conseqExecutor) { this.writers = writers; @@ -132,14 +131,6 @@ public boolean includeCallerDetail() { return includeCallerDetail; } - @Override - public boolean includeCallerThread() { - if (includeCallerThread == null) { - includeCallerThread = writers.stream().anyMatch(LogWriter::includeCallerThread); - } - return includeCallerThread; - } - @Override public void stop() { IeLogger.INFO.log("Stopping {}", this); diff --git a/src/main/java/elf4j/engine/service/writer/PerformanceSensitive.java b/src/main/java/elf4j/engine/service/writer/PerformanceSensitive.java index 7eb7106..c8d4df6 100644 --- a/src/main/java/elf4j/engine/service/writer/PerformanceSensitive.java +++ b/src/main/java/elf4j/engine/service/writer/PerformanceSensitive.java @@ -33,9 +33,4 @@ public interface PerformanceSensitive { * @return true if log should include caller detail such as method, line number... */ boolean includeCallerDetail(); - - /** - * @return true if log should include call thread information such thread name and id - */ - boolean includeCallerThread(); } diff --git a/src/main/java/elf4j/engine/service/writer/StandardStreamsWriter.java b/src/main/java/elf4j/engine/service/writer/StandardStreamsWriter.java index f24ad7b..db4e21b 100644 --- a/src/main/java/elf4j/engine/service/writer/StandardStreamsWriter.java +++ b/src/main/java/elf4j/engine/service/writer/StandardStreamsWriter.java @@ -82,11 +82,6 @@ public boolean includeCallerDetail() { return logPattern.includeCallerDetail(); } - @Override - public boolean includeCallerThread() { - return logPattern.includeCallerThread(); - } - enum OutStreamType { STDOUT, STDERR diff --git a/src/test/java/elf4j/engine/service/pattern/JsonPatternTest.java b/src/test/java/elf4j/engine/service/pattern/JsonPatternTest.java index 5ae2e93..194275e 100644 --- a/src/test/java/elf4j/engine/service/pattern/JsonPatternTest.java +++ b/src/test/java/elf4j/engine/service/pattern/JsonPatternTest.java @@ -67,7 +67,6 @@ class from { void noPatternOptionDefaults() { JsonPattern jsonPattern = JsonPattern.from("json"); - assertFalse(jsonPattern.includeCallerThread()); assertFalse(jsonPattern.includeCallerDetail()); } @@ -75,7 +74,6 @@ void noPatternOptionDefaults() { void includeCallerOption() { JsonPattern jsonPattern = JsonPattern.from("json:caller-detail"); - assertFalse(jsonPattern.includeCallerThread()); assertTrue(jsonPattern.includeCallerDetail()); } @@ -83,7 +81,6 @@ void includeCallerOption() { void includeThreadOption() { JsonPattern jsonPattern = JsonPattern.from("json:caller-thread"); - assertTrue(jsonPattern.includeCallerThread()); assertFalse(jsonPattern.includeCallerDetail()); } @@ -91,7 +88,6 @@ void includeThreadOption() { void includeCallerAndThreadOptions() { JsonPattern jsonPattern = JsonPattern.from("json:caller-thread,caller-detail"); - assertTrue(jsonPattern.includeCallerThread()); assertTrue(jsonPattern.includeCallerDetail()); } } @@ -111,4 +107,4 @@ void resolveMessage() { assertTrue(rendered.contains(mockLogEvent.getResolvedMessage())); } } -} \ No newline at end of file +}