From fc645562484b254f9fe8f85a419eb956c03a3a21 Mon Sep 17 00:00:00 2001 From: q3769 Date: Thu, 16 Mar 2023 17:24:18 -0500 Subject: [PATCH] rename --- .github/workflows/maven-publish.yml | 36 +++++++++---------- pom.xml | 2 +- .../elf4j/impl/core/writer/GroupWriter.java | 2 +- .../{LogWriterType.java => WriterType.java} | 6 ++-- .../core/writer/pattern/ClassPattern.java | 2 +- .../core/writer/pattern/GroupPattern.java | 2 +- .../impl/core/writer/pattern/JsonPattern.java | 2 +- .../core/writer/pattern/LevelPattern.java | 2 +- .../pattern/MessageAndExceptionPattern.java | 2 +- .../core/writer/pattern/MethodPattern.java | 2 +- .../{LogPatternType.java => PatternType.java} | 8 ++--- .../core/writer/pattern/ThreadPattern.java | 2 +- .../core/writer/pattern/TimestampPattern.java | 2 +- .../core/writer/pattern/VerbatimPattern.java | 4 +-- 14 files changed, 37 insertions(+), 37 deletions(-) rename src/main/java/elf4j/impl/core/writer/{LogWriterType.java => WriterType.java} (95%) rename src/main/java/elf4j/impl/core/writer/pattern/{LogPatternType.java => PatternType.java} (96%) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 03e42f1..1fb9182 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -2,27 +2,27 @@ name: OSSRH Maven Central Deploy on: release: - types: [created] + types: [ created ] jobs: publish: runs-on: ubuntu-latest environment: ossrh steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml - server-username: MAVEN_USERNAME - server-password: MAVEN_PASSWORD - gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} - gpg-passphrase: MAVEN_GPG_PASSPHRASE - - name: Publish to OSSRH for Maven Central - run: mvn --batch-mode deploy -Prelease - env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.OSSRH_GPG_SECRET_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Publish to OSSRH for Maven Central + run: mvn --batch-mode deploy -Prelease + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} diff --git a/pom.xml b/pom.xml index 85623d0..557cf88 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ io.github.elf4j elf4j-impl-core - 0.5.3 + 0.5.4 jar elf4j-impl-core Native logging service provider implementation of ELF4J (Easy Logging Facade For Java) diff --git a/src/main/java/elf4j/impl/core/writer/GroupWriter.java b/src/main/java/elf4j/impl/core/writer/GroupWriter.java index 520c192..499d17e 100644 --- a/src/main/java/elf4j/impl/core/writer/GroupWriter.java +++ b/src/main/java/elf4j/impl/core/writer/GroupWriter.java @@ -50,7 +50,7 @@ private GroupWriter(Set writers) { * @return the composite writer containing all writers configured in the specified properties */ public static GroupWriter from(Properties properties) { - return new GroupWriter(LogWriterType.parseAllLogWriters(properties)); + return new GroupWriter(WriterType.parseAllLogWriters(properties)); } @Override diff --git a/src/main/java/elf4j/impl/core/writer/LogWriterType.java b/src/main/java/elf4j/impl/core/writer/WriterType.java similarity index 95% rename from src/main/java/elf4j/impl/core/writer/LogWriterType.java rename to src/main/java/elf4j/impl/core/writer/WriterType.java index b2de281..ef7a80c 100644 --- a/src/main/java/elf4j/impl/core/writer/LogWriterType.java +++ b/src/main/java/elf4j/impl/core/writer/WriterType.java @@ -35,11 +35,11 @@ /** * */ -public enum LogWriterType { +public enum WriterType { /** * */ - StandardStreams { + STANDARD_STREAMS { @Override Set parseLogWriters(Properties properties) { return PropertiesUtils.getPropertiesGroupOfType("stream", properties) @@ -55,7 +55,7 @@ Set parseLogWriters(Properties properties) { * @return all writers parsed from the specified properties */ public static Set parseAllLogWriters(Properties properties) { - return EnumSet.allOf(LogWriterType.class) + return EnumSet.allOf(WriterType.class) .stream() .flatMap(type -> type.parseLogWriters(properties).stream()) .collect(Collectors.toSet()); diff --git a/src/main/java/elf4j/impl/core/writer/pattern/ClassPattern.java b/src/main/java/elf4j/impl/core/writer/pattern/ClassPattern.java index 3f71d2d..356b4e5 100644 --- a/src/main/java/elf4j/impl/core/writer/pattern/ClassPattern.java +++ b/src/main/java/elf4j/impl/core/writer/pattern/ClassPattern.java @@ -45,7 +45,7 @@ public class ClassPattern implements LogPattern { */ @Nonnull public static ClassPattern from(@NonNull String pattern) { - if (!LogPatternType.CLASS.isTargetTypeOf(pattern)) { + if (!PatternType.CLASS.isTargetTypeOf(pattern)) { throw new IllegalArgumentException("pattern: " + pattern); } return new ClassPattern(LogPattern.getPatternOption(pattern) diff --git a/src/main/java/elf4j/impl/core/writer/pattern/GroupPattern.java b/src/main/java/elf4j/impl/core/writer/pattern/GroupPattern.java index 367375d..adc9c29 100644 --- a/src/main/java/elf4j/impl/core/writer/pattern/GroupPattern.java +++ b/src/main/java/elf4j/impl/core/writer/pattern/GroupPattern.java @@ -45,7 +45,7 @@ public class GroupPattern implements LogPattern { */ @Nonnull public static GroupPattern from(@NonNull String pattern) { - return new GroupPattern(LogPatternType.parseAllPatternsOrThrow(pattern)); + return new GroupPattern(PatternType.parseAllPatternsOrThrow(pattern)); } @Override diff --git a/src/main/java/elf4j/impl/core/writer/pattern/JsonPattern.java b/src/main/java/elf4j/impl/core/writer/pattern/JsonPattern.java index 7ff4d49..c543552 100644 --- a/src/main/java/elf4j/impl/core/writer/pattern/JsonPattern.java +++ b/src/main/java/elf4j/impl/core/writer/pattern/JsonPattern.java @@ -60,7 +60,7 @@ public class JsonPattern implements LogPattern { * @return converted pattern object */ public static JsonPattern from(@NonNull String pattern) { - if (!LogPatternType.JSON.isTargetTypeOf(pattern)) { + if (!PatternType.JSON.isTargetTypeOf(pattern)) { throw new IllegalArgumentException("pattern: " + pattern); } Optional patternOption = LogPattern.getPatternOption(pattern); diff --git a/src/main/java/elf4j/impl/core/writer/pattern/LevelPattern.java b/src/main/java/elf4j/impl/core/writer/pattern/LevelPattern.java index 7f137a8..43bdc15 100644 --- a/src/main/java/elf4j/impl/core/writer/pattern/LevelPattern.java +++ b/src/main/java/elf4j/impl/core/writer/pattern/LevelPattern.java @@ -49,7 +49,7 @@ private LevelPattern(int displayLength) { */ @Nonnull public static LevelPattern from(@NonNull String pattern) { - if (!LogPatternType.LEVEL.isTargetTypeOf(pattern)) { + if (!PatternType.LEVEL.isTargetTypeOf(pattern)) { throw new IllegalArgumentException("pattern: " + pattern); } return new LevelPattern(LogPattern.getPatternOption(pattern) diff --git a/src/main/java/elf4j/impl/core/writer/pattern/MessageAndExceptionPattern.java b/src/main/java/elf4j/impl/core/writer/pattern/MessageAndExceptionPattern.java index 011f223..cc89f64 100644 --- a/src/main/java/elf4j/impl/core/writer/pattern/MessageAndExceptionPattern.java +++ b/src/main/java/elf4j/impl/core/writer/pattern/MessageAndExceptionPattern.java @@ -42,7 +42,7 @@ public class MessageAndExceptionPattern implements LogPattern { */ @Nonnull public static MessageAndExceptionPattern from(String pattern) { - if (!LogPatternType.MESSAGE.isTargetTypeOf(pattern)) { + if (!PatternType.MESSAGE.isTargetTypeOf(pattern)) { throw new IllegalArgumentException("pattern text: " + pattern); } return new MessageAndExceptionPattern(); diff --git a/src/main/java/elf4j/impl/core/writer/pattern/MethodPattern.java b/src/main/java/elf4j/impl/core/writer/pattern/MethodPattern.java index 29962fc..3c6ca8a 100644 --- a/src/main/java/elf4j/impl/core/writer/pattern/MethodPattern.java +++ b/src/main/java/elf4j/impl/core/writer/pattern/MethodPattern.java @@ -42,7 +42,7 @@ public class MethodPattern implements LogPattern { */ @Nonnull public static MethodPattern from(String pattern) { - if (!LogPatternType.METHOD.isTargetTypeOf(pattern)) { + if (!PatternType.METHOD.isTargetTypeOf(pattern)) { throw new IllegalArgumentException("pattern: " + pattern); } return new MethodPattern(); diff --git a/src/main/java/elf4j/impl/core/writer/pattern/LogPatternType.java b/src/main/java/elf4j/impl/core/writer/pattern/PatternType.java similarity index 96% rename from src/main/java/elf4j/impl/core/writer/pattern/LogPatternType.java rename to src/main/java/elf4j/impl/core/writer/pattern/PatternType.java index cba678c..e49303c 100644 --- a/src/main/java/elf4j/impl/core/writer/pattern/LogPatternType.java +++ b/src/main/java/elf4j/impl/core/writer/pattern/PatternType.java @@ -33,7 +33,7 @@ /** * */ -public enum LogPatternType { +public enum PatternType { /** * */ @@ -174,12 +174,12 @@ public static List parseAllPatternsOrThrow(String pattern) { iPattern = pattern.substring(i, iEnd); i = iEnd; } - logPatterns.add(LogPatternType.parsePatternOrThrow(iPattern)); + logPatterns.add(PatternType.parsePatternOrThrow(iPattern)); } return logPatterns; } - private static boolean isPatternOfType(LogPatternType targetPatternType, String pattern) { + private static boolean isPatternOfType(PatternType targetPatternType, String pattern) { if (targetPatternType == VERBATIM) { return EnumSet.complementOf(EnumSet.of(VERBATIM)).stream().noneMatch(type -> type.isTargetTypeOf(pattern)); } @@ -187,7 +187,7 @@ private static boolean isPatternOfType(LogPatternType targetPatternType, String } private static LogPattern parsePatternOrThrow(String pattern) { - return EnumSet.allOf(LogPatternType.class) + return EnumSet.allOf(PatternType.class) .stream() .map(type -> type.parsePattern(pattern)) .filter(Objects::nonNull) diff --git a/src/main/java/elf4j/impl/core/writer/pattern/ThreadPattern.java b/src/main/java/elf4j/impl/core/writer/pattern/ThreadPattern.java index a17391f..b71f2c6 100644 --- a/src/main/java/elf4j/impl/core/writer/pattern/ThreadPattern.java +++ b/src/main/java/elf4j/impl/core/writer/pattern/ThreadPattern.java @@ -45,7 +45,7 @@ public class ThreadPattern implements LogPattern { */ @Nonnull public static ThreadPattern from(@NonNull String pattern) { - if (!LogPatternType.THREAD.isTargetTypeOf(pattern)) { + if (!PatternType.THREAD.isTargetTypeOf(pattern)) { throw new IllegalArgumentException("pattern: " + pattern); } return new ThreadPattern(LogPattern.getPatternOption(pattern) diff --git a/src/main/java/elf4j/impl/core/writer/pattern/TimestampPattern.java b/src/main/java/elf4j/impl/core/writer/pattern/TimestampPattern.java index 211d8ec..95406d0 100644 --- a/src/main/java/elf4j/impl/core/writer/pattern/TimestampPattern.java +++ b/src/main/java/elf4j/impl/core/writer/pattern/TimestampPattern.java @@ -49,7 +49,7 @@ public class TimestampPattern implements LogPattern { */ @Nonnull public static TimestampPattern from(@NonNull String pattern) { - if (!LogPatternType.TIMESTAMP.isTargetTypeOf(pattern)) { + if (!PatternType.TIMESTAMP.isTargetTypeOf(pattern)) { throw new IllegalArgumentException("pattern: " + pattern); } DateTimeFormatter dateTimeFormatter = LogPattern.getPatternOption(pattern) diff --git a/src/main/java/elf4j/impl/core/writer/pattern/VerbatimPattern.java b/src/main/java/elf4j/impl/core/writer/pattern/VerbatimPattern.java index 52121aa..2836ee5 100644 --- a/src/main/java/elf4j/impl/core/writer/pattern/VerbatimPattern.java +++ b/src/main/java/elf4j/impl/core/writer/pattern/VerbatimPattern.java @@ -44,11 +44,11 @@ public class VerbatimPattern implements LogPattern { */ @Nonnull public static VerbatimPattern from(String pattern) { - if (!LogPatternType.VERBATIM.isTargetTypeOf(pattern)) { + if (!PatternType.VERBATIM.isTargetTypeOf(pattern)) { throw new IllegalArgumentException(String.format( "pattern '%s' looks to be targeted at another known pattern type than %s", pattern, - LogPatternType.VERBATIM)); + PatternType.VERBATIM)); } return new VerbatimPattern(pattern); }