From e05b2f9567e8591a13adaa73932f573abd1546a7 Mon Sep 17 00:00:00 2001 From: Will Sargent Date: Thu, 19 Dec 2024 11:40:48 -0800 Subject: [PATCH] Remove package prefix and move logging specific code to logging --- api/build.gradle | 3 -- .../{spi => api}/AttributesAware.java | 6 +--- .../echopraxia/{spi => api}/DefaultField.java | 3 +- .../DefaultToStringFormatter.java | 35 ++++++++++--------- api/src/main/java/echopraxia/api/Field.java | 2 -- .../java/echopraxia/api/FieldBuilder.java | 3 +- .../{spi => api}/FieldConstants.java | 2 +- .../echopraxia/api/PresentationField.java | 3 -- .../api/PresentationFieldBuilder.java | 3 +- .../PresentationHintAttributes.java | 7 +--- .../{spi => api}/PresentationHints.java | 4 +-- .../echopraxia/api/SimpleFieldVisitor.java | 1 - .../echopraxia/api/ToStringFormatter.java | 1 - api/src/main/java/echopraxia/api/Value.java | 1 - .../echopraxia/api/AbbreviateAfterTests.java | 1 - .../{spi => api}/AbbreviationTests.java | 4 +-- .../java/echopraxia/api/CardinalTests.java | 4 +-- .../{spi => api}/DisplayNameTests.java | 8 ++--- .../test/java/echopraxia/api/ElidedTests.java | 2 -- .../java/echopraxia/api/EqualityTests.java | 1 - .../echopraxia/api/ToStringFormatTests.java | 1 - .../echopraxia/api/ToStringValueTests.java | 2 +- api/src/test/resources/echopraxia.properties | 1 - .../echopraxia.spi.EchopraxiaServiceProvider | 1 - async/build.gradle | 2 +- .../java/echopraxia/async/AsyncLogger.java | 9 +++-- .../echopraxia/async/AsyncLoggerFactory.java | 6 ++-- .../echopraxia/async/AsyncLoggerMethods.java | 4 +-- .../async/DefaultAsyncLoggerMethods.java | 11 +++--- diff/build.gradle | 2 +- .../diff/DiffFieldBuilderTests.java | 12 +++---- diff/src/test/resources/logback-test.xml | 2 +- fluent/build.gradle | 2 +- .../java/echopraxia/fluent/FluentLogger.java | 11 +++--- .../fluent/FluentLoggerFactory.java | 6 ++-- jackson/build.gradle | 2 +- .../echopraxia/jackson/FieldSerializer.java | 2 +- jul/build.gradle | 2 +- .../java/echopraxia/jul/JULCoreLogger.java | 9 +++-- .../echopraxia/jul/JULEchopraxiaService.java | 4 +-- .../jul/JULEchopraxiaServiceProvider.java | 4 +-- .../java/echopraxia/jul/JULLoggerContext.java | 4 +-- .../echopraxia/jul/JULLoggingContext.java | 10 +++--- ...xia.logging.spi.EchopraxiaServiceProvider} | 0 .../echopraxia/jul/ExceptionHandlerTests.java | 2 +- .../echopraxia/jul/LoggerFactoryTest.java | 4 +-- .../jul/StaticExceptionHandler.java | 2 +- .../test/java/echopraxia/jul/TestBase.java | 5 ++- .../jul/TestEchopraxiaServiceProvider.java | 4 +-- ...xia.logging.spi.EchopraxiaServiceProvider} | 0 log4j/build.gradle | 2 +- .../log4j/CoreLoggerBenchmarks.java | 8 ++--- .../echopraxia/log4j/LoggerBenchmarks.java | 9 +++-- .../echopraxia/log4j/Log4JCoreLogger.java | 11 +++--- .../log4j/Log4JEchopraxiaService.java | 4 +-- .../log4j/Log4JEchopraxiaServiceProvider.java | 4 +-- .../echopraxia/log4j/Log4JLoggingContext.java | 10 +++--- ...xia.logging.spi.EchopraxiaServiceProvider} | 0 .../java/echopraxia/log4j/ConditionTest.java | 4 +-- .../java/echopraxia/log4j/ContextTest.java | 8 ++--- .../log4j/ExceptionHandlerTests.java | 2 +- .../echopraxia/log4j/Log4JLoggerTest.java | 3 +- .../log4j/StaticExceptionHandler.java | 2 +- .../test/java/echopraxia/log4j/TestBase.java | 4 +-- .../log4j/TestEchopraxiaServiceProvider.java | 4 +-- ...xia.logging.spi.EchopraxiaServiceProvider} | 0 logback/build.gradle | 4 +-- .../logback/AbstractEventLoggingContext.java | 4 +-- .../logback/ArgumentLoggingContext.java | 4 +-- .../echopraxia/logback/ConditionMarker.java | 2 +- .../logback/ConditionTurboFilter.java | 3 ++ .../logback/FieldLoggingContext.java | 4 +-- .../logback/LogbackLoggerContext.java | 2 +- .../logback/LogbackLoggingContext.java | 10 +++--- .../logback/MarkerLoggingContext.java | 4 +-- .../logback/ConditionTurboFilterTest.java | 2 +- logger/build.gradle | 2 +- .../{ => logger}/DefaultLoggerMethods.java | 11 +++--- .../java/echopraxia/{ => logger}/Logger.java | 9 +++-- .../{ => logger}/LoggerFactory.java | 11 +++--- .../{ => logger}/LoggerMethods.java | 4 +-- logger/src/test/java/echopraxia/MyLogger.java | 13 +++---- logging/build.gradle | 11 ++++++ .../echopraxia/logging}/api/Condition.java | 4 ++- .../java/echopraxia/logging}/api/Level.java | 2 +- .../echopraxia/logging}/api/LoggerHandle.java | 3 +- .../logging}/api/LoggingContext.java | 7 ++-- .../spi/AbstractEchopraxiaService.java | 4 +-- .../logging}/spi/AbstractJsonPathFinder.java | 4 +-- .../logging}/spi/AbstractLoggerSupport.java | 5 ++- .../java/echopraxia/logging}/spi/Caller.java | 2 +- .../echopraxia/logging}/spi/CoreLogger.java | 5 ++- .../logging}/spi/CoreLoggerFactory.java | 2 +- .../logging}/spi/CoreLoggerFilter.java | 2 +- .../logging}/spi/DefaultMethodsSupport.java | 2 +- .../logging}/spi/DelegateCoreLogger.java | 5 ++- .../logging}/spi/EchopraxiaJsonProvider.java | 6 ++-- .../spi/EchopraxiaMappingProvider.java | 4 +-- .../logging}/spi/EchopraxiaService.java | 2 +- .../spi/EchopraxiaServiceProvider.java | 2 +- .../logging}/spi/ExceptionHandler.java | 2 +- .../java/echopraxia/logging}/spi/Filters.java | 2 +- .../logging}/spi/FindPathMethods.java | 2 +- .../logging}/spi/LoggerContext.java | 2 +- .../echopraxia/logging}/spi/Utilities.java | 3 +- .../logging}/api/ConditionTests.java | 10 +++--- .../echopraxia/logging}/api/FilterTests.java | 7 ++-- .../logging}/api/JsonPathTests.java | 13 ++++--- .../echopraxia/logging}/api/LevelTests.java | 2 +- .../echopraxia/logging}/api/TestFilter.java | 7 ++-- .../src/test/resources/echopraxia.properties | 1 + .../logging}/fake/FakeCoreLogger.java | 11 +++--- .../logging}/fake/FakeEchopraxiaService.java | 6 ++-- .../fake/FakeEchopraxiaServiceProvider.java | 6 ++-- .../logging}/fake/FakeLoggerContext.java | 8 ++--- .../logging}/fake/FakeLoggingContext.java | 8 ++--- ...axia.logging.spi.EchopraxiaServiceProvider | 1 + .../logstash/AsyncLoggerBenchmarks.java | 4 +-- .../logstash/CoreLoggerBenchmarks.java | 6 ++-- .../logstash/FakeLoggingContext.java | 6 ++-- .../logstash/JsonPathBenchmarks.java | 4 ++- .../echopraxia/logstash/LoggerBenchmarks.java | 9 +++-- .../logstash/LogstashCoreLogger.java | 14 +++++--- .../logstash/LogstashEchopraxiaService.java | 4 +-- .../LogstashEchopraxiaServiceProvider.java | 4 +-- ...xia.logging.spi.EchopraxiaServiceProvider} | 0 .../echopraxia/logstash/ConditionTest.java | 5 ++- .../java/echopraxia/logstash/ContextTest.java | 11 +++--- .../echopraxia/logstash/ConverterTest.java | 2 +- .../java/echopraxia/logstash/DirectTest.java | 2 +- .../logstash/ExceptionHandlerTests.java | 2 +- .../logstash/LoggerFactoryTest.java | 4 +-- .../logstash/LogstashLoggerTest.java | 3 +- .../logstash/StaticExceptionHandler.java | 2 +- .../java/echopraxia/logstash/TestBase.java | 5 ++- .../TestEchopraxiaServiceProvider.java | 4 +-- ...xia.logging.spi.EchopraxiaServiceProvider} | 0 noop/build.gradle | 2 +- .../java/echopraxia/noop/NoopCoreLogger.java | 9 +++-- .../noop/NoopEchopraxiaService.java | 4 +-- .../noop/NoopEchopraxiaServiceProvider.java | 4 +-- .../echopraxia/noop/NoopLoggerContext.java | 6 ++-- .../echopraxia/noop/NoopLoggingContext.java | 6 ++-- ...xia.logging.spi.EchopraxiaServiceProvider} | 0 scripting/build.gradle | 2 +- .../scripting/FakeLoggingContext.java | 6 ++-- .../scripting/ScriptingBenchmarks.java | 4 ++- .../echopraxia/scripting/ScriptCondition.java | 6 ++-- .../echopraxia/scripting/ScriptManager.java | 4 +-- .../scripting/FakeLoggingContext.java | 6 ++-- .../test/java/echopraxia/scripting/Main.java | 6 ++-- .../scripting/ScriptConditionTest.java | 6 ++-- .../scripting/ScriptManagerTest.java | 4 +-- semantic/build.gradle | 2 +- .../echopraxia/semantic/SemanticLogger.java | 5 ++- .../semantic/SemanticLoggerFactory.java | 13 ++++--- .../semantic/SemanticLoggerTest.java | 4 +-- settings.gradle | 1 + 158 files changed, 368 insertions(+), 370 deletions(-) rename api/src/main/java/echopraxia/{spi => api}/AttributesAware.java (84%) rename api/src/main/java/echopraxia/{spi => api}/DefaultField.java (98%) rename api/src/main/java/echopraxia/{spi => api}/DefaultToStringFormatter.java (84%) rename api/src/main/java/echopraxia/{spi => api}/FieldConstants.java (96%) rename api/src/main/java/echopraxia/{spi => api}/PresentationHintAttributes.java (95%) rename api/src/main/java/echopraxia/{spi => api}/PresentationHints.java (93%) rename api/src/test/java/echopraxia/{spi => api}/AbbreviationTests.java (95%) rename api/src/test/java/echopraxia/{spi => api}/DisplayNameTests.java (77%) delete mode 100644 api/src/test/resources/echopraxia.properties delete mode 100644 api/src/testFixtures/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider rename jul/src/main/resources/META-INF/services/{echopraxia.spi.EchopraxiaServiceProvider => echopraxia.logging.spi.EchopraxiaServiceProvider} (100%) rename jul/src/test/resources/META-INF/services/{echopraxia.spi.EchopraxiaServiceProvider => echopraxia.logging.spi.EchopraxiaServiceProvider} (100%) rename log4j/src/main/resources/META-INF/services/{echopraxia.spi.EchopraxiaServiceProvider => echopraxia.logging.spi.EchopraxiaServiceProvider} (100%) rename log4j/src/test/resources/META-INF/services/{echopraxia.spi.EchopraxiaServiceProvider => echopraxia.logging.spi.EchopraxiaServiceProvider} (100%) rename logger/src/main/java/echopraxia/{ => logger}/DefaultLoggerMethods.java (98%) rename logger/src/main/java/echopraxia/{ => logger}/Logger.java (98%) rename logger/src/main/java/echopraxia/{ => logger}/LoggerFactory.java (92%) rename logger/src/main/java/echopraxia/{ => logger}/LoggerMethods.java (99%) create mode 100644 logging/build.gradle rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/api/Condition.java (98%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/api/Level.java (95%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/api/LoggerHandle.java (89%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/api/LoggingContext.java (86%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/AbstractEchopraxiaService.java (94%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/AbstractJsonPathFinder.java (98%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/AbstractLoggerSupport.java (97%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/Caller.java (96%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/CoreLogger.java (98%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/CoreLoggerFactory.java (96%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/CoreLoggerFilter.java (92%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/DefaultMethodsSupport.java (94%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/DelegateCoreLogger.java (97%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/EchopraxiaJsonProvider.java (98%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/EchopraxiaMappingProvider.java (98%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/EchopraxiaService.java (98%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/EchopraxiaServiceProvider.java (78%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/ExceptionHandler.java (72%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/Filters.java (99%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/FindPathMethods.java (98%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/LoggerContext.java (84%) rename {api/src/main/java/echopraxia => logging/src/main/java/echopraxia/logging}/spi/Utilities.java (98%) rename {api/src/test/java/echopraxia => logging/src/test/java/echopraxia/logging}/api/ConditionTests.java (93%) rename {api/src/test/java/echopraxia => logging/src/test/java/echopraxia/logging}/api/FilterTests.java (85%) rename {api/src/test/java/echopraxia => logging/src/test/java/echopraxia/logging}/api/JsonPathTests.java (96%) rename {api/src/test/java/echopraxia => logging/src/test/java/echopraxia/logging}/api/LevelTests.java (97%) rename {api/src/test/java/echopraxia => logging/src/test/java/echopraxia/logging}/api/TestFilter.java (60%) create mode 100644 logging/src/test/resources/echopraxia.properties rename {api/src/testFixtures/java/echopraxia => logging/src/testFixtures/java/echopraxia/logging}/fake/FakeCoreLogger.java (97%) rename {api/src/testFixtures/java/echopraxia => logging/src/testFixtures/java/echopraxia/logging}/fake/FakeEchopraxiaService.java (77%) rename {api/src/testFixtures/java/echopraxia => logging/src/testFixtures/java/echopraxia/logging}/fake/FakeEchopraxiaServiceProvider.java (58%) rename {api/src/testFixtures/java/echopraxia => logging/src/testFixtures/java/echopraxia/logging}/fake/FakeLoggerContext.java (79%) rename {api/src/testFixtures/java/echopraxia => logging/src/testFixtures/java/echopraxia/logging}/fake/FakeLoggingContext.java (94%) create mode 100644 logging/src/testFixtures/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider rename logstash/src/main/resources/META-INF/services/{echopraxia.spi.EchopraxiaServiceProvider => echopraxia.logging.spi.EchopraxiaServiceProvider} (100%) rename logstash/src/test/resources/META-INF/services/{echopraxia.spi.EchopraxiaServiceProvider => echopraxia.logging.spi.EchopraxiaServiceProvider} (100%) rename noop/src/main/resources/META-INF/services/{echopraxia.spi.EchopraxiaServiceProvider => echopraxia.logging.spi.EchopraxiaServiceProvider} (100%) diff --git a/api/build.gradle b/api/build.gradle index 7e6d402d..d8dd93a9 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -1,10 +1,7 @@ plugins { id 'java-library' - id 'java-test-fixtures' } dependencies { - // https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path - implementation "com.jayway.jsonpath:json-path:$jsonPathVersion" implementation 'org.pcollections:pcollections:4.0.1' } diff --git a/api/src/main/java/echopraxia/spi/AttributesAware.java b/api/src/main/java/echopraxia/api/AttributesAware.java similarity index 84% rename from api/src/main/java/echopraxia/spi/AttributesAware.java rename to api/src/main/java/echopraxia/api/AttributesAware.java index 79bc3415..b78e73ab 100644 --- a/api/src/main/java/echopraxia/spi/AttributesAware.java +++ b/api/src/main/java/echopraxia/api/AttributesAware.java @@ -1,9 +1,5 @@ -package echopraxia.spi; +package echopraxia.api; -import echopraxia.api.Attribute; -import echopraxia.api.AttributeKey; -import echopraxia.api.Attributes; -import echopraxia.api.Field; import java.util.Collection; import org.jetbrains.annotations.NotNull; diff --git a/api/src/main/java/echopraxia/spi/DefaultField.java b/api/src/main/java/echopraxia/api/DefaultField.java similarity index 98% rename from api/src/main/java/echopraxia/spi/DefaultField.java rename to api/src/main/java/echopraxia/api/DefaultField.java index 8c8dda7a..77e39b54 100644 --- a/api/src/main/java/echopraxia/spi/DefaultField.java +++ b/api/src/main/java/echopraxia/api/DefaultField.java @@ -1,6 +1,5 @@ -package echopraxia.spi; +package echopraxia.api; -import echopraxia.api.*; import java.util.Collection; import java.util.Collections; import java.util.List; diff --git a/api/src/main/java/echopraxia/spi/DefaultToStringFormatter.java b/api/src/main/java/echopraxia/api/DefaultToStringFormatter.java similarity index 84% rename from api/src/main/java/echopraxia/spi/DefaultToStringFormatter.java rename to api/src/main/java/echopraxia/api/DefaultToStringFormatter.java index 5a0f35d2..f32ca828 100644 --- a/api/src/main/java/echopraxia/spi/DefaultToStringFormatter.java +++ b/api/src/main/java/echopraxia/api/DefaultToStringFormatter.java @@ -1,8 +1,5 @@ -package echopraxia.spi; +package echopraxia.api; -import static echopraxia.spi.PresentationHintAttributes.*; - -import echopraxia.api.*; import java.util.List; import java.util.stream.Collectors; import org.jetbrains.annotations.NotNull; @@ -44,12 +41,16 @@ public String formatField(@NotNull Field field) { // if the field has elided, tostringvalue, abbreviateafter, or ascardinal, // it should apply to the value instead. Attributes collectValueAttributes(Attributes fa, Attributes valueAttributes) { - if (fa.containsKey(ABBREVIATE_AFTER)) { - return valueAttributes.plus(abbreviateAfter(fa.get(ABBREVIATE_AFTER))); - } else if (fa.containsKey(AS_CARDINAL)) { - return valueAttributes.plus(asCardinal()); - } else if (fa.containsKey(TOSTRING_VALUE)) { - return valueAttributes.plus(withToStringValue(fa.get(TOSTRING_VALUE))); + if (fa.containsKey(PresentationHintAttributes.ABBREVIATE_AFTER)) { + return valueAttributes.plus( + PresentationHintAttributes.abbreviateAfter( + fa.get(PresentationHintAttributes.ABBREVIATE_AFTER))); + } else if (fa.containsKey(PresentationHintAttributes.AS_CARDINAL)) { + return valueAttributes.plus(PresentationHintAttributes.asCardinal()); + } else if (fa.containsKey(PresentationHintAttributes.TOSTRING_VALUE)) { + return valueAttributes.plus( + PresentationHintAttributes.withToStringValue( + fa.get(PresentationHintAttributes.TOSTRING_VALUE))); } else { return valueAttributes; } @@ -181,11 +182,11 @@ private void formatName( } private static boolean isToStringFormat(Attributes attributes) { - return attributes.containsKey(TOSTRING_FORMAT); + return attributes.containsKey(PresentationHintAttributes.TOSTRING_FORMAT); } private static @Nullable FieldVisitor getToStringFormat(Attributes attributes) { - return attributes.get(TOSTRING_FORMAT); + return attributes.get(PresentationHintAttributes.TOSTRING_FORMAT); } private static boolean isDisplayName(@NotNull Attributes attributes) { @@ -197,15 +198,15 @@ private static boolean isDisplayName(@NotNull Attributes attributes) { } private boolean isAbbreviateAfter(@NotNull Attributes attributes) { - return attributes.containsKey(ABBREVIATE_AFTER); + return attributes.containsKey(PresentationHintAttributes.ABBREVIATE_AFTER); } private static @Nullable Integer getAbbreviateAfter(@NotNull Attributes attributes) { - return attributes.get(ABBREVIATE_AFTER); + return attributes.get(PresentationHintAttributes.ABBREVIATE_AFTER); } private boolean isAsCardinal(@NotNull Attributes attributes) { - return attributes.containsKey(AS_CARDINAL); + return attributes.containsKey(PresentationHintAttributes.AS_CARDINAL); } private boolean isValueOnly(Attributes attributes) { @@ -217,10 +218,10 @@ private boolean isElided(Attributes attributes) { } private boolean isToStringValue(Attributes attributes) { - return attributes.containsKey(TOSTRING_VALUE); + return attributes.containsKey(PresentationHintAttributes.TOSTRING_VALUE); } private String getToStringValue(Attributes attributes) { - return attributes.get(TOSTRING_VALUE); + return attributes.get(PresentationHintAttributes.TOSTRING_VALUE); } } diff --git a/api/src/main/java/echopraxia/api/Field.java b/api/src/main/java/echopraxia/api/Field.java index 84732912..53ed6a05 100644 --- a/api/src/main/java/echopraxia/api/Field.java +++ b/api/src/main/java/echopraxia/api/Field.java @@ -1,7 +1,5 @@ package echopraxia.api; -import echopraxia.spi.DefaultField; -import echopraxia.spi.PresentationHintAttributes; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.concurrent.atomic.LongAdder; diff --git a/api/src/main/java/echopraxia/api/FieldBuilder.java b/api/src/main/java/echopraxia/api/FieldBuilder.java index 3a895f7e..9b105514 100644 --- a/api/src/main/java/echopraxia/api/FieldBuilder.java +++ b/api/src/main/java/echopraxia/api/FieldBuilder.java @@ -1,8 +1,7 @@ package echopraxia.api; -import static echopraxia.spi.FieldConstants.EXCEPTION; +import static echopraxia.api.FieldConstants.EXCEPTION; -import echopraxia.spi.DefaultField; import java.math.BigDecimal; import java.math.BigInteger; import java.util.List; diff --git a/api/src/main/java/echopraxia/spi/FieldConstants.java b/api/src/main/java/echopraxia/api/FieldConstants.java similarity index 96% rename from api/src/main/java/echopraxia/spi/FieldConstants.java rename to api/src/main/java/echopraxia/api/FieldConstants.java index 8edd2545..7e5bb794 100644 --- a/api/src/main/java/echopraxia/spi/FieldConstants.java +++ b/api/src/main/java/echopraxia/api/FieldConstants.java @@ -1,4 +1,4 @@ -package echopraxia.spi; +package echopraxia.api; import java.util.ResourceBundle; diff --git a/api/src/main/java/echopraxia/api/PresentationField.java b/api/src/main/java/echopraxia/api/PresentationField.java index 919bd1ae..4b35f5e4 100644 --- a/api/src/main/java/echopraxia/api/PresentationField.java +++ b/api/src/main/java/echopraxia/api/PresentationField.java @@ -1,7 +1,4 @@ package echopraxia.api; -import echopraxia.spi.AttributesAware; -import echopraxia.spi.PresentationHints; - public interface PresentationField extends Field, PresentationHints, AttributesAware {} diff --git a/api/src/main/java/echopraxia/api/PresentationFieldBuilder.java b/api/src/main/java/echopraxia/api/PresentationFieldBuilder.java index a4813d82..05f2d37b 100644 --- a/api/src/main/java/echopraxia/api/PresentationFieldBuilder.java +++ b/api/src/main/java/echopraxia/api/PresentationFieldBuilder.java @@ -1,8 +1,7 @@ package echopraxia.api; -import static echopraxia.spi.FieldConstants.EXCEPTION; +import static echopraxia.api.FieldConstants.EXCEPTION; -import echopraxia.spi.DefaultField; import java.math.BigDecimal; import java.math.BigInteger; import java.util.List; diff --git a/api/src/main/java/echopraxia/spi/PresentationHintAttributes.java b/api/src/main/java/echopraxia/api/PresentationHintAttributes.java similarity index 95% rename from api/src/main/java/echopraxia/spi/PresentationHintAttributes.java rename to api/src/main/java/echopraxia/api/PresentationHintAttributes.java index 5bf3709a..8c4c13ed 100644 --- a/api/src/main/java/echopraxia/spi/PresentationHintAttributes.java +++ b/api/src/main/java/echopraxia/api/PresentationHintAttributes.java @@ -1,10 +1,5 @@ -package echopraxia.spi; +package echopraxia.api; -import echopraxia.api.*; -import echopraxia.api.Attribute; -import echopraxia.api.AttributeKey; -import echopraxia.api.Attributes; -import echopraxia.api.FieldVisitor; import org.jetbrains.annotations.NotNull; /** diff --git a/api/src/main/java/echopraxia/spi/PresentationHints.java b/api/src/main/java/echopraxia/api/PresentationHints.java similarity index 93% rename from api/src/main/java/echopraxia/spi/PresentationHints.java rename to api/src/main/java/echopraxia/api/PresentationHints.java index 843800b8..88117aad 100644 --- a/api/src/main/java/echopraxia/spi/PresentationHints.java +++ b/api/src/main/java/echopraxia/api/PresentationHints.java @@ -1,7 +1,5 @@ -package echopraxia.spi; +package echopraxia.api; -import echopraxia.api.Field; -import echopraxia.api.FieldVisitor; import org.jetbrains.annotations.NotNull; /** diff --git a/api/src/main/java/echopraxia/api/SimpleFieldVisitor.java b/api/src/main/java/echopraxia/api/SimpleFieldVisitor.java index c6171702..9aa3eb58 100644 --- a/api/src/main/java/echopraxia/api/SimpleFieldVisitor.java +++ b/api/src/main/java/echopraxia/api/SimpleFieldVisitor.java @@ -1,6 +1,5 @@ package echopraxia.api; -import echopraxia.spi.DefaultField; import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.List; diff --git a/api/src/main/java/echopraxia/api/ToStringFormatter.java b/api/src/main/java/echopraxia/api/ToStringFormatter.java index f1a89207..71ad8576 100644 --- a/api/src/main/java/echopraxia/api/ToStringFormatter.java +++ b/api/src/main/java/echopraxia/api/ToStringFormatter.java @@ -1,6 +1,5 @@ package echopraxia.api; -import echopraxia.spi.DefaultToStringFormatter; import org.jetbrains.annotations.NotNull; /** diff --git a/api/src/main/java/echopraxia/api/Value.java b/api/src/main/java/echopraxia/api/Value.java index e089a09c..4d5e66b4 100644 --- a/api/src/main/java/echopraxia/api/Value.java +++ b/api/src/main/java/echopraxia/api/Value.java @@ -1,6 +1,5 @@ package echopraxia.api; -import echopraxia.spi.PresentationHintAttributes; import java.math.BigDecimal; import java.math.BigInteger; import java.util.*; diff --git a/api/src/test/java/echopraxia/api/AbbreviateAfterTests.java b/api/src/test/java/echopraxia/api/AbbreviateAfterTests.java index 92d046b7..f0c7c551 100644 --- a/api/src/test/java/echopraxia/api/AbbreviateAfterTests.java +++ b/api/src/test/java/echopraxia/api/AbbreviateAfterTests.java @@ -2,7 +2,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.spi.PresentationHintAttributes; import org.junit.jupiter.api.Test; public class AbbreviateAfterTests { diff --git a/api/src/test/java/echopraxia/spi/AbbreviationTests.java b/api/src/test/java/echopraxia/api/AbbreviationTests.java similarity index 95% rename from api/src/test/java/echopraxia/spi/AbbreviationTests.java rename to api/src/test/java/echopraxia/api/AbbreviationTests.java index c4d5427c..6a8a1851 100644 --- a/api/src/test/java/echopraxia/spi/AbbreviationTests.java +++ b/api/src/test/java/echopraxia/api/AbbreviationTests.java @@ -1,9 +1,7 @@ -package echopraxia.spi; +package echopraxia.api; import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.api.Field; -import echopraxia.api.Value; import org.junit.jupiter.api.Test; public class AbbreviationTests { diff --git a/api/src/test/java/echopraxia/api/CardinalTests.java b/api/src/test/java/echopraxia/api/CardinalTests.java index d8bc3e2a..865e0ef9 100644 --- a/api/src/test/java/echopraxia/api/CardinalTests.java +++ b/api/src/test/java/echopraxia/api/CardinalTests.java @@ -1,10 +1,8 @@ package echopraxia.api; -import static echopraxia.spi.PresentationHintAttributes.asCardinal; +import static echopraxia.api.PresentationHintAttributes.asCardinal; import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.spi.DefaultField; -import echopraxia.spi.PresentationHintAttributes; import java.util.UUID; import org.junit.jupiter.api.Test; diff --git a/api/src/test/java/echopraxia/spi/DisplayNameTests.java b/api/src/test/java/echopraxia/api/DisplayNameTests.java similarity index 77% rename from api/src/test/java/echopraxia/spi/DisplayNameTests.java rename to api/src/test/java/echopraxia/api/DisplayNameTests.java index 85c0a739..f0feb9bb 100644 --- a/api/src/test/java/echopraxia/spi/DisplayNameTests.java +++ b/api/src/test/java/echopraxia/api/DisplayNameTests.java @@ -1,12 +1,8 @@ -package echopraxia.spi; +package echopraxia.api; -import static echopraxia.spi.PresentationHintAttributes.withDisplayName; +import static echopraxia.api.PresentationHintAttributes.withDisplayName; import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.api.*; -import echopraxia.api.Attributes; -import echopraxia.api.Field; -import echopraxia.api.Value; import org.junit.jupiter.api.Test; public class DisplayNameTests { diff --git a/api/src/test/java/echopraxia/api/ElidedTests.java b/api/src/test/java/echopraxia/api/ElidedTests.java index 0ef11a88..e1bcf709 100644 --- a/api/src/test/java/echopraxia/api/ElidedTests.java +++ b/api/src/test/java/echopraxia/api/ElidedTests.java @@ -4,8 +4,6 @@ import static echopraxia.api.Value.string; import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.spi.DefaultField; -import echopraxia.spi.PresentationHintAttributes; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/api/src/test/java/echopraxia/api/EqualityTests.java b/api/src/test/java/echopraxia/api/EqualityTests.java index e3c91850..2d6f81d6 100644 --- a/api/src/test/java/echopraxia/api/EqualityTests.java +++ b/api/src/test/java/echopraxia/api/EqualityTests.java @@ -2,7 +2,6 @@ import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.spi.DefaultField; import java.math.BigDecimal; import java.util.List; import org.junit.jupiter.api.Test; diff --git a/api/src/test/java/echopraxia/api/ToStringFormatTests.java b/api/src/test/java/echopraxia/api/ToStringFormatTests.java index 4e8ba89c..ab39fe57 100644 --- a/api/src/test/java/echopraxia/api/ToStringFormatTests.java +++ b/api/src/test/java/echopraxia/api/ToStringFormatTests.java @@ -4,7 +4,6 @@ import static echopraxia.api.Value.string; import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.spi.DefaultField; import java.time.Duration; import java.util.*; import org.jetbrains.annotations.NotNull; diff --git a/api/src/test/java/echopraxia/api/ToStringValueTests.java b/api/src/test/java/echopraxia/api/ToStringValueTests.java index 4c970f01..17ef4add 100644 --- a/api/src/test/java/echopraxia/api/ToStringValueTests.java +++ b/api/src/test/java/echopraxia/api/ToStringValueTests.java @@ -1,6 +1,6 @@ package echopraxia.api; -import static echopraxia.spi.PresentationHintAttributes.withToStringValue; +import static echopraxia.api.PresentationHintAttributes.withToStringValue; import static org.assertj.core.api.Assertions.assertThat; import java.time.Duration; diff --git a/api/src/test/resources/echopraxia.properties b/api/src/test/resources/echopraxia.properties deleted file mode 100644 index a4375980..00000000 --- a/api/src/test/resources/echopraxia.properties +++ /dev/null @@ -1 +0,0 @@ -filter.0=echopraxia.api.TestFilter \ No newline at end of file diff --git a/api/src/testFixtures/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider b/api/src/testFixtures/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider deleted file mode 100644 index d5c876db..00000000 --- a/api/src/testFixtures/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider +++ /dev/null @@ -1 +0,0 @@ -echopraxia.fake.FakeEchopraxiaServiceProvider \ No newline at end of file diff --git a/async/build.gradle b/async/build.gradle index 6d34e9a9..6416ed09 100644 --- a/async/build.gradle +++ b/async/build.gradle @@ -3,7 +3,7 @@ plugins { } dependencies { - api project(":api") + api project(":logging") jmhImplementation project(":logstash") diff --git a/async/src/main/java/echopraxia/async/AsyncLogger.java b/async/src/main/java/echopraxia/async/AsyncLogger.java index e0783edc..6144ccaa 100644 --- a/async/src/main/java/echopraxia/async/AsyncLogger.java +++ b/async/src/main/java/echopraxia/async/AsyncLogger.java @@ -1,11 +1,10 @@ package echopraxia.async; -import echopraxia.api.*; -import echopraxia.api.Condition; import echopraxia.api.FieldBuilderResult; -import echopraxia.api.LoggerHandle; -import echopraxia.spi.AbstractLoggerSupport; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.LoggerHandle; +import echopraxia.logging.spi.AbstractLoggerSupport; +import echopraxia.logging.spi.CoreLogger; import java.util.concurrent.Executor; import java.util.function.Consumer; import java.util.function.Function; diff --git a/async/src/main/java/echopraxia/async/AsyncLoggerFactory.java b/async/src/main/java/echopraxia/async/AsyncLoggerFactory.java index 03bd76aa..a09c11b5 100644 --- a/async/src/main/java/echopraxia/async/AsyncLoggerFactory.java +++ b/async/src/main/java/echopraxia/async/AsyncLoggerFactory.java @@ -1,9 +1,9 @@ package echopraxia.async; import echopraxia.api.PresentationFieldBuilder; -import echopraxia.spi.Caller; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.CoreLoggerFactory; +import echopraxia.logging.spi.Caller; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.CoreLoggerFactory; import org.jetbrains.annotations.NotNull; /** diff --git a/async/src/main/java/echopraxia/async/AsyncLoggerMethods.java b/async/src/main/java/echopraxia/async/AsyncLoggerMethods.java index 5dc0c764..12dd2579 100644 --- a/async/src/main/java/echopraxia/async/AsyncLoggerMethods.java +++ b/async/src/main/java/echopraxia/async/AsyncLoggerMethods.java @@ -1,8 +1,8 @@ package echopraxia.async; -import echopraxia.api.Condition; import echopraxia.api.FieldBuilderResult; -import echopraxia.api.LoggerHandle; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.LoggerHandle; import java.util.function.Consumer; import java.util.function.Function; import org.jetbrains.annotations.NotNull; diff --git a/async/src/main/java/echopraxia/async/DefaultAsyncLoggerMethods.java b/async/src/main/java/echopraxia/async/DefaultAsyncLoggerMethods.java index 03ce4cf2..34fc226b 100644 --- a/async/src/main/java/echopraxia/async/DefaultAsyncLoggerMethods.java +++ b/async/src/main/java/echopraxia/async/DefaultAsyncLoggerMethods.java @@ -1,15 +1,14 @@ package echopraxia.async; -import static echopraxia.api.Level.*; +import static echopraxia.api.FieldConstants.EXCEPTION; import static echopraxia.api.Value.exception; -import static echopraxia.spi.FieldConstants.EXCEPTION; +import static echopraxia.logging.api.Level.*; -import echopraxia.api.*; -import echopraxia.api.Condition; import echopraxia.api.Field; import echopraxia.api.FieldBuilderResult; -import echopraxia.api.LoggerHandle; -import echopraxia.spi.DefaultMethodsSupport; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.LoggerHandle; +import echopraxia.logging.spi.DefaultMethodsSupport; import java.util.function.Consumer; import java.util.function.Function; import org.jetbrains.annotations.NotNull; diff --git a/diff/build.gradle b/diff/build.gradle index b14cba1c..aefe2ecb 100644 --- a/diff/build.gradle +++ b/diff/build.gradle @@ -3,7 +3,7 @@ plugins { } dependencies { - api project(":api") + api project(":logging") api project(":jackson") // https://github.com/flipkart-incubator/zjsonpatch/ diff --git a/diff/src/test/java/echopraxia/diff/DiffFieldBuilderTests.java b/diff/src/test/java/echopraxia/diff/DiffFieldBuilderTests.java index d0c6fcc1..c4c7aa34 100644 --- a/diff/src/test/java/echopraxia/diff/DiffFieldBuilderTests.java +++ b/diff/src/test/java/echopraxia/diff/DiffFieldBuilderTests.java @@ -6,13 +6,12 @@ import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.read.ListAppender; -import echopraxia.Logger; -import echopraxia.LoggerFactory; -import echopraxia.api.*; +import echopraxia.api.DefaultField; import echopraxia.api.Field; import echopraxia.api.FieldBuilder; import echopraxia.api.Value; -import echopraxia.spi.DefaultField; +import echopraxia.logger.Logger; +import echopraxia.logger.LoggerFactory; import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -21,8 +20,7 @@ public class DiffFieldBuilderTests { @Test public void testLogger() { - Logger logger = - LoggerFactory.getLogger().withFieldBuilder(PersonFieldBuilder.instance); + Logger logger = LoggerFactory.getLogger(PersonFieldBuilder.instance); Person before = new Person("Eloise", 1); Person after = before.withName("Will"); @@ -31,6 +29,8 @@ public void testLogger() { ListAppender listAppender = getListAppender(); List list = listAppender.list; + assertThat(list).isNotEmpty(); + ILoggingEvent event = list.get(0); assertThat(event.getFormattedMessage()) .isEqualTo("personDiff=[{op=replace, path=/name, value=Will}]"); diff --git a/diff/src/test/resources/logback-test.xml b/diff/src/test/resources/logback-test.xml index bc396f65..a6b4c50f 100644 --- a/diff/src/test/resources/logback-test.xml +++ b/diff/src/test/resources/logback-test.xml @@ -9,7 +9,7 @@ - + diff --git a/fluent/build.gradle b/fluent/build.gradle index 6d34e9a9..6416ed09 100644 --- a/fluent/build.gradle +++ b/fluent/build.gradle @@ -3,7 +3,7 @@ plugins { } dependencies { - api project(":api") + api project(":logging") jmhImplementation project(":logstash") diff --git a/fluent/src/main/java/echopraxia/fluent/FluentLogger.java b/fluent/src/main/java/echopraxia/fluent/FluentLogger.java index cc98ad44..4c5f2d41 100644 --- a/fluent/src/main/java/echopraxia/fluent/FluentLogger.java +++ b/fluent/src/main/java/echopraxia/fluent/FluentLogger.java @@ -1,13 +1,12 @@ package echopraxia.fluent; -import echopraxia.api.*; -import echopraxia.api.Condition; import echopraxia.api.Field; import echopraxia.api.FieldBuilderResult; -import echopraxia.api.Level; -import echopraxia.spi.AbstractLoggerSupport; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.Utilities; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.spi.AbstractLoggerSupport; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.Utilities; import java.util.ArrayList; import java.util.List; import java.util.function.Function; diff --git a/fluent/src/main/java/echopraxia/fluent/FluentLoggerFactory.java b/fluent/src/main/java/echopraxia/fluent/FluentLoggerFactory.java index bd76c2e2..eb9c9bc1 100644 --- a/fluent/src/main/java/echopraxia/fluent/FluentLoggerFactory.java +++ b/fluent/src/main/java/echopraxia/fluent/FluentLoggerFactory.java @@ -1,9 +1,9 @@ package echopraxia.fluent; import echopraxia.api.PresentationFieldBuilder; -import echopraxia.spi.Caller; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.CoreLoggerFactory; +import echopraxia.logging.spi.Caller; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.CoreLoggerFactory; import org.jetbrains.annotations.NotNull; /** The factory for FluentLogger. */ diff --git a/jackson/build.gradle b/jackson/build.gradle index c9192d42..1f4ff728 100644 --- a/jackson/build.gradle +++ b/jackson/build.gradle @@ -6,7 +6,7 @@ dependencies { api project(":api") testImplementation 'net.javacrumbs.json-unit:json-unit-assertj:2.38.0' - testImplementation(testFixtures(project(':api'))) + testImplementation(testFixtures(project(':logging'))) // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind api "com.fasterxml.jackson.core:jackson-databind:$jacksonDatabindVersion" diff --git a/jackson/src/main/java/echopraxia/jackson/FieldSerializer.java b/jackson/src/main/java/echopraxia/jackson/FieldSerializer.java index dcb3b39e..9d48f2fd 100644 --- a/jackson/src/main/java/echopraxia/jackson/FieldSerializer.java +++ b/jackson/src/main/java/echopraxia/jackson/FieldSerializer.java @@ -5,8 +5,8 @@ import com.fasterxml.jackson.databind.ser.std.StdSerializer; import echopraxia.api.Field; import echopraxia.api.FieldVisitor; +import echopraxia.api.PresentationHintAttributes; import echopraxia.api.Value; -import echopraxia.spi.PresentationHintAttributes; import java.io.IOException; import java.math.BigDecimal; import java.math.BigInteger; diff --git a/jul/build.gradle b/jul/build.gradle index 41b0a5c6..b58d69f2 100644 --- a/jul/build.gradle +++ b/jul/build.gradle @@ -3,7 +3,7 @@ plugins { } dependencies { - api project(":api") + api project(":logging") api project(":jackson") // Cannot add a hard transitive dependency that can evict things here diff --git a/jul/src/main/java/echopraxia/jul/JULCoreLogger.java b/jul/src/main/java/echopraxia/jul/JULCoreLogger.java index ebad1db8..633b0f69 100644 --- a/jul/src/main/java/echopraxia/jul/JULCoreLogger.java +++ b/jul/src/main/java/echopraxia/jul/JULCoreLogger.java @@ -1,9 +1,12 @@ package echopraxia.jul; import echopraxia.api.*; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.EchopraxiaService; -import echopraxia.spi.LoggerContext; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggerHandle; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.EchopraxiaService; +import echopraxia.logging.spi.LoggerContext; import java.util.Collections; import java.util.List; import java.util.Map; diff --git a/jul/src/main/java/echopraxia/jul/JULEchopraxiaService.java b/jul/src/main/java/echopraxia/jul/JULEchopraxiaService.java index 0f8759ee..e56c8cd0 100644 --- a/jul/src/main/java/echopraxia/jul/JULEchopraxiaService.java +++ b/jul/src/main/java/echopraxia/jul/JULEchopraxiaService.java @@ -1,7 +1,7 @@ package echopraxia.jul; -import echopraxia.spi.AbstractEchopraxiaService; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.spi.AbstractEchopraxiaService; +import echopraxia.logging.spi.CoreLogger; import java.util.logging.Logger; import org.jetbrains.annotations.NotNull; diff --git a/jul/src/main/java/echopraxia/jul/JULEchopraxiaServiceProvider.java b/jul/src/main/java/echopraxia/jul/JULEchopraxiaServiceProvider.java index a39c4289..2b706675 100644 --- a/jul/src/main/java/echopraxia/jul/JULEchopraxiaServiceProvider.java +++ b/jul/src/main/java/echopraxia/jul/JULEchopraxiaServiceProvider.java @@ -1,7 +1,7 @@ package echopraxia.jul; -import echopraxia.spi.EchopraxiaService; -import echopraxia.spi.EchopraxiaServiceProvider; +import echopraxia.logging.spi.EchopraxiaService; +import echopraxia.logging.spi.EchopraxiaServiceProvider; public class JULEchopraxiaServiceProvider implements EchopraxiaServiceProvider { @Override diff --git a/jul/src/main/java/echopraxia/jul/JULLoggerContext.java b/jul/src/main/java/echopraxia/jul/JULLoggerContext.java index ffd8c703..77a26714 100644 --- a/jul/src/main/java/echopraxia/jul/JULLoggerContext.java +++ b/jul/src/main/java/echopraxia/jul/JULLoggerContext.java @@ -1,9 +1,9 @@ package echopraxia.jul; -import static echopraxia.spi.Utilities.joinFields; +import static echopraxia.logging.spi.Utilities.joinFields; import echopraxia.api.Field; -import echopraxia.spi.LoggerContext; +import echopraxia.logging.spi.LoggerContext; import java.util.Collections; import java.util.List; import java.util.function.Supplier; diff --git a/jul/src/main/java/echopraxia/jul/JULLoggingContext.java b/jul/src/main/java/echopraxia/jul/JULLoggingContext.java index ac092bfe..b8e9bccd 100644 --- a/jul/src/main/java/echopraxia/jul/JULLoggingContext.java +++ b/jul/src/main/java/echopraxia/jul/JULLoggingContext.java @@ -1,12 +1,12 @@ package echopraxia.jul; -import static echopraxia.spi.Utilities.joinFields; -import static echopraxia.spi.Utilities.memoize; +import static echopraxia.logging.spi.Utilities.joinFields; +import static echopraxia.logging.spi.Utilities.memoize; import echopraxia.api.Field; -import echopraxia.api.LoggingContext; -import echopraxia.spi.AbstractJsonPathFinder; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.api.LoggingContext; +import echopraxia.logging.spi.AbstractJsonPathFinder; +import echopraxia.logging.spi.CoreLogger; import java.util.Collections; import java.util.List; import java.util.function.Supplier; diff --git a/jul/src/main/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider b/jul/src/main/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider similarity index 100% rename from jul/src/main/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider rename to jul/src/main/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider diff --git a/jul/src/test/java/echopraxia/jul/ExceptionHandlerTests.java b/jul/src/test/java/echopraxia/jul/ExceptionHandlerTests.java index 8497f348..c26f8233 100644 --- a/jul/src/test/java/echopraxia/jul/ExceptionHandlerTests.java +++ b/jul/src/test/java/echopraxia/jul/ExceptionHandlerTests.java @@ -2,7 +2,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.api.Condition; +import echopraxia.logging.api.Condition; import org.junit.jupiter.api.Test; public class ExceptionHandlerTests extends TestBase { diff --git a/jul/src/test/java/echopraxia/jul/LoggerFactoryTest.java b/jul/src/test/java/echopraxia/jul/LoggerFactoryTest.java index 93008416..979ee844 100644 --- a/jul/src/test/java/echopraxia/jul/LoggerFactoryTest.java +++ b/jul/src/test/java/echopraxia/jul/LoggerFactoryTest.java @@ -2,9 +2,9 @@ import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.Logger; -import echopraxia.LoggerFactory; import echopraxia.api.PresentationFieldBuilder; +import echopraxia.logger.Logger; +import echopraxia.logger.LoggerFactory; import org.junit.jupiter.api.Test; public class LoggerFactoryTest { diff --git a/jul/src/test/java/echopraxia/jul/StaticExceptionHandler.java b/jul/src/test/java/echopraxia/jul/StaticExceptionHandler.java index be4cb04b..3e58a24a 100644 --- a/jul/src/test/java/echopraxia/jul/StaticExceptionHandler.java +++ b/jul/src/test/java/echopraxia/jul/StaticExceptionHandler.java @@ -1,6 +1,6 @@ package echopraxia.jul; -import echopraxia.spi.ExceptionHandler; +import echopraxia.logging.spi.ExceptionHandler; import java.util.ArrayList; import java.util.List; diff --git a/jul/src/test/java/echopraxia/jul/TestBase.java b/jul/src/test/java/echopraxia/jul/TestBase.java index 88b5a052..6c148c7e 100644 --- a/jul/src/test/java/echopraxia/jul/TestBase.java +++ b/jul/src/test/java/echopraxia/jul/TestBase.java @@ -1,11 +1,10 @@ package echopraxia.jul; -import echopraxia.*; -import echopraxia.Logger; -import echopraxia.LoggerFactory; import echopraxia.api.PresentationFieldBuilder; import echopraxia.async.AsyncLogger; import echopraxia.async.AsyncLoggerFactory; +import echopraxia.logger.Logger; +import echopraxia.logger.LoggerFactory; import java.io.IOException; import java.util.logging.Handler; import java.util.logging.Level; diff --git a/jul/src/test/java/echopraxia/jul/TestEchopraxiaServiceProvider.java b/jul/src/test/java/echopraxia/jul/TestEchopraxiaServiceProvider.java index c59414f7..c9858691 100644 --- a/jul/src/test/java/echopraxia/jul/TestEchopraxiaServiceProvider.java +++ b/jul/src/test/java/echopraxia/jul/TestEchopraxiaServiceProvider.java @@ -1,7 +1,7 @@ package echopraxia.jul; -import echopraxia.spi.EchopraxiaService; -import echopraxia.spi.EchopraxiaServiceProvider; +import echopraxia.logging.spi.EchopraxiaService; +import echopraxia.logging.spi.EchopraxiaServiceProvider; public class TestEchopraxiaServiceProvider implements EchopraxiaServiceProvider { @Override diff --git a/jul/src/test/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider b/jul/src/test/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider similarity index 100% rename from jul/src/test/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider rename to jul/src/test/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider diff --git a/log4j/build.gradle b/log4j/build.gradle index 436e9e69..d86ede2e 100644 --- a/log4j/build.gradle +++ b/log4j/build.gradle @@ -3,7 +3,7 @@ plugins { } dependencies { - api project(":api") + api project(":logging") api project(":jackson") compileOnly "org.apache.logging.log4j:log4j-core:$log4j2Version" diff --git a/log4j/src/jmh/java/echopraxia/log4j/CoreLoggerBenchmarks.java b/log4j/src/jmh/java/echopraxia/log4j/CoreLoggerBenchmarks.java index 7caf6b8a..17e146e8 100644 --- a/log4j/src/jmh/java/echopraxia/log4j/CoreLoggerBenchmarks.java +++ b/log4j/src/jmh/java/echopraxia/log4j/CoreLoggerBenchmarks.java @@ -1,10 +1,10 @@ package echopraxia.log4j; -import echopraxia.Logger; import echopraxia.api.FieldBuilder; -import echopraxia.api.Level; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.CoreLoggerFactory; +import echopraxia.logger.Logger; +import echopraxia.logging.api.Level; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.CoreLoggerFactory; import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.infra.Blackhole; diff --git a/log4j/src/jmh/java/echopraxia/log4j/LoggerBenchmarks.java b/log4j/src/jmh/java/echopraxia/log4j/LoggerBenchmarks.java index a81d6e0f..d4e29731 100644 --- a/log4j/src/jmh/java/echopraxia/log4j/LoggerBenchmarks.java +++ b/log4j/src/jmh/java/echopraxia/log4j/LoggerBenchmarks.java @@ -1,11 +1,10 @@ package echopraxia.log4j; -import echopraxia.*; -import echopraxia.Logger; -import echopraxia.LoggerFactory; -import echopraxia.api.Condition; -import echopraxia.api.Level; import echopraxia.api.PresentationFieldBuilder; +import echopraxia.logger.Logger; +import echopraxia.logger.LoggerFactory; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.infra.Blackhole; diff --git a/log4j/src/main/java/echopraxia/log4j/Log4JCoreLogger.java b/log4j/src/main/java/echopraxia/log4j/Log4JCoreLogger.java index ff4d7fa6..7747d23b 100644 --- a/log4j/src/main/java/echopraxia/log4j/Log4JCoreLogger.java +++ b/log4j/src/main/java/echopraxia/log4j/Log4JCoreLogger.java @@ -1,12 +1,15 @@ package echopraxia.log4j; -import static echopraxia.spi.Utilities.joinFields; +import static echopraxia.logging.spi.Utilities.joinFields; import echopraxia.api.*; import echopraxia.log4j.layout.EchopraxiaFieldsMessage; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.EchopraxiaService; -import echopraxia.spi.LoggerContext; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggerHandle; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.EchopraxiaService; +import echopraxia.logging.spi.LoggerContext; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; diff --git a/log4j/src/main/java/echopraxia/log4j/Log4JEchopraxiaService.java b/log4j/src/main/java/echopraxia/log4j/Log4JEchopraxiaService.java index f897c052..15440ae6 100644 --- a/log4j/src/main/java/echopraxia/log4j/Log4JEchopraxiaService.java +++ b/log4j/src/main/java/echopraxia/log4j/Log4JEchopraxiaService.java @@ -1,7 +1,7 @@ package echopraxia.log4j; -import echopraxia.spi.AbstractEchopraxiaService; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.spi.AbstractEchopraxiaService; +import echopraxia.logging.spi.CoreLogger; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.spi.ExtendedLogger; import org.jetbrains.annotations.NotNull; diff --git a/log4j/src/main/java/echopraxia/log4j/Log4JEchopraxiaServiceProvider.java b/log4j/src/main/java/echopraxia/log4j/Log4JEchopraxiaServiceProvider.java index 5588e990..21fce9ef 100644 --- a/log4j/src/main/java/echopraxia/log4j/Log4JEchopraxiaServiceProvider.java +++ b/log4j/src/main/java/echopraxia/log4j/Log4JEchopraxiaServiceProvider.java @@ -1,7 +1,7 @@ package echopraxia.log4j; -import echopraxia.spi.EchopraxiaService; -import echopraxia.spi.EchopraxiaServiceProvider; +import echopraxia.logging.spi.EchopraxiaService; +import echopraxia.logging.spi.EchopraxiaServiceProvider; public class Log4JEchopraxiaServiceProvider implements EchopraxiaServiceProvider { @Override diff --git a/log4j/src/main/java/echopraxia/log4j/Log4JLoggingContext.java b/log4j/src/main/java/echopraxia/log4j/Log4JLoggingContext.java index b3fb49fa..72e9e301 100644 --- a/log4j/src/main/java/echopraxia/log4j/Log4JLoggingContext.java +++ b/log4j/src/main/java/echopraxia/log4j/Log4JLoggingContext.java @@ -1,12 +1,12 @@ package echopraxia.log4j; -import static echopraxia.spi.Utilities.joinFields; -import static echopraxia.spi.Utilities.memoize; +import static echopraxia.logging.spi.Utilities.joinFields; +import static echopraxia.logging.spi.Utilities.memoize; import echopraxia.api.Field; -import echopraxia.api.LoggingContext; -import echopraxia.spi.AbstractJsonPathFinder; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.api.LoggingContext; +import echopraxia.logging.spi.AbstractJsonPathFinder; +import echopraxia.logging.spi.CoreLogger; import java.util.Collections; import java.util.List; import java.util.function.Supplier; diff --git a/log4j/src/main/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider b/log4j/src/main/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider similarity index 100% rename from log4j/src/main/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider rename to log4j/src/main/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider diff --git a/log4j/src/test/java/echopraxia/log4j/ConditionTest.java b/log4j/src/test/java/echopraxia/log4j/ConditionTest.java index 3c844614..15cf944e 100644 --- a/log4j/src/test/java/echopraxia/log4j/ConditionTest.java +++ b/log4j/src/test/java/echopraxia/log4j/ConditionTest.java @@ -7,9 +7,9 @@ import static org.awaitility.Awaitility.await; import com.fasterxml.jackson.databind.JsonNode; -import echopraxia.api.Condition; -import echopraxia.api.Level; import echopraxia.log4j.appender.ListAppender; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; diff --git a/log4j/src/test/java/echopraxia/log4j/ContextTest.java b/log4j/src/test/java/echopraxia/log4j/ContextTest.java index 891b1523..a919a303 100644 --- a/log4j/src/test/java/echopraxia/log4j/ContextTest.java +++ b/log4j/src/test/java/echopraxia/log4j/ContextTest.java @@ -3,12 +3,12 @@ import static org.assertj.core.api.Assertions.assertThat; import com.fasterxml.jackson.databind.JsonNode; -import echopraxia.Logger; -import echopraxia.LoggerFactory; -import echopraxia.api.Condition; import echopraxia.api.Field; import echopraxia.api.FieldBuilder; -import echopraxia.spi.CoreLoggerFactory; +import echopraxia.logger.Logger; +import echopraxia.logger.LoggerFactory; +import echopraxia.logging.api.Condition; +import echopraxia.logging.spi.CoreLoggerFactory; import java.util.Map; import org.apache.logging.log4j.Marker; import org.apache.logging.log4j.MarkerManager; diff --git a/log4j/src/test/java/echopraxia/log4j/ExceptionHandlerTests.java b/log4j/src/test/java/echopraxia/log4j/ExceptionHandlerTests.java index 358c2f44..378b37d6 100644 --- a/log4j/src/test/java/echopraxia/log4j/ExceptionHandlerTests.java +++ b/log4j/src/test/java/echopraxia/log4j/ExceptionHandlerTests.java @@ -2,7 +2,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.api.Condition; +import echopraxia.logging.api.Condition; import org.junit.jupiter.api.Test; public class ExceptionHandlerTests extends TestBase { diff --git a/log4j/src/test/java/echopraxia/log4j/Log4JLoggerTest.java b/log4j/src/test/java/echopraxia/log4j/Log4JLoggerTest.java index c0b27347..19bb4298 100644 --- a/log4j/src/test/java/echopraxia/log4j/Log4JLoggerTest.java +++ b/log4j/src/test/java/echopraxia/log4j/Log4JLoggerTest.java @@ -3,12 +3,11 @@ import static org.assertj.core.api.Assertions.assertThat; import com.fasterxml.jackson.databind.JsonNode; -import echopraxia.*; -import echopraxia.LoggerFactory; import echopraxia.api.Field; import echopraxia.api.FieldBuilder; import echopraxia.api.Value; import echopraxia.async.AsyncLoggerFactory; +import echopraxia.logger.LoggerFactory; import org.junit.jupiter.api.Test; public class Log4JLoggerTest extends TestBase { diff --git a/log4j/src/test/java/echopraxia/log4j/StaticExceptionHandler.java b/log4j/src/test/java/echopraxia/log4j/StaticExceptionHandler.java index 131bca44..ec368297 100644 --- a/log4j/src/test/java/echopraxia/log4j/StaticExceptionHandler.java +++ b/log4j/src/test/java/echopraxia/log4j/StaticExceptionHandler.java @@ -1,6 +1,6 @@ package echopraxia.log4j; -import echopraxia.spi.ExceptionHandler; +import echopraxia.logging.spi.ExceptionHandler; import java.util.ArrayList; import java.util.List; diff --git a/log4j/src/test/java/echopraxia/log4j/TestBase.java b/log4j/src/test/java/echopraxia/log4j/TestBase.java index 130bed33..d7295e7d 100644 --- a/log4j/src/test/java/echopraxia/log4j/TestBase.java +++ b/log4j/src/test/java/echopraxia/log4j/TestBase.java @@ -5,12 +5,12 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import echopraxia.Logger; -import echopraxia.LoggerFactory; import echopraxia.api.PresentationFieldBuilder; import echopraxia.async.AsyncLogger; import echopraxia.async.AsyncLoggerFactory; import echopraxia.log4j.appender.ListAppender; +import echopraxia.logger.Logger; +import echopraxia.logger.LoggerFactory; import java.util.List; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.BeforeEach; diff --git a/log4j/src/test/java/echopraxia/log4j/TestEchopraxiaServiceProvider.java b/log4j/src/test/java/echopraxia/log4j/TestEchopraxiaServiceProvider.java index c4f331f2..0da849c6 100644 --- a/log4j/src/test/java/echopraxia/log4j/TestEchopraxiaServiceProvider.java +++ b/log4j/src/test/java/echopraxia/log4j/TestEchopraxiaServiceProvider.java @@ -1,7 +1,7 @@ package echopraxia.log4j; -import echopraxia.spi.EchopraxiaService; -import echopraxia.spi.EchopraxiaServiceProvider; +import echopraxia.logging.spi.EchopraxiaService; +import echopraxia.logging.spi.EchopraxiaServiceProvider; public class TestEchopraxiaServiceProvider implements EchopraxiaServiceProvider { @Override diff --git a/log4j/src/test/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider b/log4j/src/test/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider similarity index 100% rename from log4j/src/test/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider rename to log4j/src/test/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider diff --git a/logback/build.gradle b/logback/build.gradle index f2161fa3..c7883a43 100644 --- a/logback/build.gradle +++ b/logback/build.gradle @@ -3,14 +3,14 @@ plugins { } dependencies { - api project(":api") + api project(":logging") // We don't depend on SLF4J 2.x or Logback 1.3 features, but we don't want to bind // consumers to them either. compileOnly "org.slf4j:slf4j-api:$slf4jApiVersion" compileOnly "ch.qos.logback:logback-classic:$logbackVersion" - testImplementation(testFixtures(project(':api'))) + testImplementation(testFixtures(project(':logging'))) testImplementation "org.slf4j:slf4j-api:1.7.36" testImplementation "ch.qos.logback:logback-classic:1.2.12" } diff --git a/logback/src/main/java/echopraxia/logback/AbstractEventLoggingContext.java b/logback/src/main/java/echopraxia/logback/AbstractEventLoggingContext.java index f7bab897..508ee2c8 100644 --- a/logback/src/main/java/echopraxia/logback/AbstractEventLoggingContext.java +++ b/logback/src/main/java/echopraxia/logback/AbstractEventLoggingContext.java @@ -2,8 +2,8 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import echopraxia.api.Field; -import echopraxia.api.LoggingContext; -import echopraxia.spi.AbstractJsonPathFinder; +import echopraxia.logging.api.LoggingContext; +import echopraxia.logging.spi.AbstractJsonPathFinder; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; diff --git a/logback/src/main/java/echopraxia/logback/ArgumentLoggingContext.java b/logback/src/main/java/echopraxia/logback/ArgumentLoggingContext.java index 419e0967..52089a9b 100644 --- a/logback/src/main/java/echopraxia/logback/ArgumentLoggingContext.java +++ b/logback/src/main/java/echopraxia/logback/ArgumentLoggingContext.java @@ -1,10 +1,10 @@ package echopraxia.logback; -import static echopraxia.spi.Utilities.memoize; +import static echopraxia.logging.spi.Utilities.memoize; import ch.qos.logback.classic.spi.ILoggingEvent; import echopraxia.api.Field; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.spi.CoreLogger; import java.util.*; import java.util.function.Supplier; import org.jetbrains.annotations.NotNull; diff --git a/logback/src/main/java/echopraxia/logback/ConditionMarker.java b/logback/src/main/java/echopraxia/logback/ConditionMarker.java index fb65aafe..456c529a 100644 --- a/logback/src/main/java/echopraxia/logback/ConditionMarker.java +++ b/logback/src/main/java/echopraxia/logback/ConditionMarker.java @@ -1,6 +1,6 @@ package echopraxia.logback; -import echopraxia.api.Condition; +import echopraxia.logging.api.Condition; import org.jetbrains.annotations.NotNull; public class ConditionMarker extends BaseMarker { diff --git a/logback/src/main/java/echopraxia/logback/ConditionTurboFilter.java b/logback/src/main/java/echopraxia/logback/ConditionTurboFilter.java index 531d5138..dfbbf03b 100644 --- a/logback/src/main/java/echopraxia/logback/ConditionTurboFilter.java +++ b/logback/src/main/java/echopraxia/logback/ConditionTurboFilter.java @@ -4,6 +4,9 @@ import ch.qos.logback.classic.turbo.TurboFilter; import ch.qos.logback.core.spi.FilterReply; import echopraxia.api.*; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggingContext; import java.util.*; import org.jetbrains.annotations.NotNull; import org.slf4j.Marker; diff --git a/logback/src/main/java/echopraxia/logback/FieldLoggingContext.java b/logback/src/main/java/echopraxia/logback/FieldLoggingContext.java index fc79d569..f9479831 100644 --- a/logback/src/main/java/echopraxia/logback/FieldLoggingContext.java +++ b/logback/src/main/java/echopraxia/logback/FieldLoggingContext.java @@ -1,10 +1,10 @@ package echopraxia.logback; -import static echopraxia.spi.Utilities.memoize; +import static echopraxia.logging.spi.Utilities.memoize; import ch.qos.logback.classic.spi.ILoggingEvent; import echopraxia.api.Field; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.spi.CoreLogger; import java.util.*; import java.util.function.Supplier; import org.jetbrains.annotations.NotNull; diff --git a/logback/src/main/java/echopraxia/logback/LogbackLoggerContext.java b/logback/src/main/java/echopraxia/logback/LogbackLoggerContext.java index 4274e655..e0fcc13a 100644 --- a/logback/src/main/java/echopraxia/logback/LogbackLoggerContext.java +++ b/logback/src/main/java/echopraxia/logback/LogbackLoggerContext.java @@ -1,6 +1,6 @@ package echopraxia.logback; -import echopraxia.spi.LoggerContext; +import echopraxia.logging.spi.LoggerContext; import java.util.List; import org.jetbrains.annotations.NotNull; import org.slf4j.Marker; diff --git a/logback/src/main/java/echopraxia/logback/LogbackLoggingContext.java b/logback/src/main/java/echopraxia/logback/LogbackLoggingContext.java index 7979bc77..3b384d7a 100644 --- a/logback/src/main/java/echopraxia/logback/LogbackLoggingContext.java +++ b/logback/src/main/java/echopraxia/logback/LogbackLoggingContext.java @@ -1,12 +1,12 @@ package echopraxia.logback; -import static echopraxia.spi.Utilities.joinFields; -import static echopraxia.spi.Utilities.memoize; +import static echopraxia.logging.spi.Utilities.joinFields; +import static echopraxia.logging.spi.Utilities.memoize; import echopraxia.api.Field; -import echopraxia.api.LoggingContext; -import echopraxia.spi.AbstractJsonPathFinder; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.api.LoggingContext; +import echopraxia.logging.spi.AbstractJsonPathFinder; +import echopraxia.logging.spi.CoreLogger; import java.util.Collections; import java.util.List; import java.util.function.Supplier; diff --git a/logback/src/main/java/echopraxia/logback/MarkerLoggingContext.java b/logback/src/main/java/echopraxia/logback/MarkerLoggingContext.java index 26de1ea6..c0ad9179 100644 --- a/logback/src/main/java/echopraxia/logback/MarkerLoggingContext.java +++ b/logback/src/main/java/echopraxia/logback/MarkerLoggingContext.java @@ -1,10 +1,10 @@ package echopraxia.logback; -import static echopraxia.spi.Utilities.memoize; +import static echopraxia.logging.spi.Utilities.memoize; import ch.qos.logback.classic.spi.ILoggingEvent; import echopraxia.api.Field; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.spi.CoreLogger; import java.util.Collections; import java.util.List; import java.util.function.Supplier; diff --git a/logback/src/test/java/echopraxia/logback/ConditionTurboFilterTest.java b/logback/src/test/java/echopraxia/logback/ConditionTurboFilterTest.java index ac28dec1..8739f325 100644 --- a/logback/src/test/java/echopraxia/logback/ConditionTurboFilterTest.java +++ b/logback/src/test/java/echopraxia/logback/ConditionTurboFilterTest.java @@ -4,9 +4,9 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.read.ListAppender; -import echopraxia.api.Condition; import echopraxia.api.FieldBuilder; import echopraxia.api.Value; +import echopraxia.logging.api.Condition; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.Marker; diff --git a/logger/build.gradle b/logger/build.gradle index 5deff656..81aab40b 100644 --- a/logger/build.gradle +++ b/logger/build.gradle @@ -3,7 +3,7 @@ plugins { } dependencies { - api project(":api") + api project(":logging") jmhImplementation project(":logstash") diff --git a/logger/src/main/java/echopraxia/DefaultLoggerMethods.java b/logger/src/main/java/echopraxia/logger/DefaultLoggerMethods.java similarity index 98% rename from logger/src/main/java/echopraxia/DefaultLoggerMethods.java rename to logger/src/main/java/echopraxia/logger/DefaultLoggerMethods.java index f35692e1..c64a5503 100644 --- a/logger/src/main/java/echopraxia/DefaultLoggerMethods.java +++ b/logger/src/main/java/echopraxia/logger/DefaultLoggerMethods.java @@ -1,14 +1,13 @@ -package echopraxia; +package echopraxia.logger; -import static echopraxia.api.Level.*; -import static echopraxia.api.Level.ERROR; +import static echopraxia.api.FieldConstants.EXCEPTION; import static echopraxia.api.Value.exception; -import static echopraxia.spi.FieldConstants.EXCEPTION; +import static echopraxia.logging.api.Level.*; -import echopraxia.api.Condition; import echopraxia.api.Field; import echopraxia.api.FieldBuilderResult; -import echopraxia.spi.DefaultMethodsSupport; +import echopraxia.logging.api.Condition; +import echopraxia.logging.spi.DefaultMethodsSupport; import java.util.Arrays; import java.util.function.Function; import java.util.stream.Collectors; diff --git a/logger/src/main/java/echopraxia/Logger.java b/logger/src/main/java/echopraxia/logger/Logger.java similarity index 98% rename from logger/src/main/java/echopraxia/Logger.java rename to logger/src/main/java/echopraxia/logger/Logger.java index 6a60f006..e0256022 100644 --- a/logger/src/main/java/echopraxia/Logger.java +++ b/logger/src/main/java/echopraxia/logger/Logger.java @@ -1,10 +1,9 @@ -package echopraxia; +package echopraxia.logger; -import echopraxia.api.*; -import echopraxia.api.Condition; import echopraxia.api.FieldBuilderResult; -import echopraxia.spi.AbstractLoggerSupport; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.api.Condition; +import echopraxia.logging.spi.AbstractLoggerSupport; +import echopraxia.logging.spi.CoreLogger; import java.util.function.Function; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/logger/src/main/java/echopraxia/LoggerFactory.java b/logger/src/main/java/echopraxia/logger/LoggerFactory.java similarity index 92% rename from logger/src/main/java/echopraxia/LoggerFactory.java rename to logger/src/main/java/echopraxia/logger/LoggerFactory.java index c01df7fb..e8a8f94e 100644 --- a/logger/src/main/java/echopraxia/LoggerFactory.java +++ b/logger/src/main/java/echopraxia/logger/LoggerFactory.java @@ -1,11 +1,10 @@ -package echopraxia; +package echopraxia.logger; -import echopraxia.api.*; import echopraxia.api.FieldBuilder; import echopraxia.api.PresentationFieldBuilder; -import echopraxia.spi.Caller; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.CoreLoggerFactory; +import echopraxia.logging.spi.Caller; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.CoreLoggerFactory; import org.jetbrains.annotations.NotNull; /** @@ -24,7 +23,7 @@ public class LoggerFactory { */ @NotNull public static Logger getLogger(Class clazz) { - final CoreLogger core = CoreLoggerFactory.getLogger(Logger.FQCN, clazz); + final CoreLogger core = CoreLoggerFactory.getLogger(echopraxia.logger.Logger.FQCN, clazz); return getLogger(core, PresentationFieldBuilder.instance()); } diff --git a/logger/src/main/java/echopraxia/LoggerMethods.java b/logger/src/main/java/echopraxia/logger/LoggerMethods.java similarity index 99% rename from logger/src/main/java/echopraxia/LoggerMethods.java rename to logger/src/main/java/echopraxia/logger/LoggerMethods.java index 8647466f..f82e16ea 100644 --- a/logger/src/main/java/echopraxia/LoggerMethods.java +++ b/logger/src/main/java/echopraxia/logger/LoggerMethods.java @@ -1,7 +1,7 @@ -package echopraxia; +package echopraxia.logger; -import echopraxia.api.Condition; import echopraxia.api.FieldBuilderResult; +import echopraxia.logging.api.Condition; import java.util.function.Function; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/logger/src/test/java/echopraxia/MyLogger.java b/logger/src/test/java/echopraxia/MyLogger.java index b074b0de..f7500faf 100644 --- a/logger/src/test/java/echopraxia/MyLogger.java +++ b/logger/src/test/java/echopraxia/MyLogger.java @@ -1,12 +1,13 @@ package echopraxia; -import echopraxia.api.*; -import echopraxia.api.Condition; -import echopraxia.api.Level; import echopraxia.api.PresentationFieldBuilder; -import echopraxia.spi.AbstractLoggerSupport; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.CoreLoggerFactory; +import echopraxia.logger.DefaultLoggerMethods; +import echopraxia.logger.LoggerMethods; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.spi.AbstractLoggerSupport; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.CoreLoggerFactory; import org.jetbrains.annotations.NotNull; public class MyLogger extends AbstractLoggerSupport diff --git a/logging/build.gradle b/logging/build.gradle new file mode 100644 index 00000000..a513b91e --- /dev/null +++ b/logging/build.gradle @@ -0,0 +1,11 @@ +plugins { + id 'java-library' + id 'java-test-fixtures' +} + +dependencies { + api project(":api") + + // https://mvnrepository.com/artifact/com.jayway.jsonpath/json-path + implementation "com.jayway.jsonpath:json-path:$jsonPathVersion" +} diff --git a/api/src/main/java/echopraxia/api/Condition.java b/logging/src/main/java/echopraxia/logging/api/Condition.java similarity index 98% rename from api/src/main/java/echopraxia/api/Condition.java rename to logging/src/main/java/echopraxia/logging/api/Condition.java index 78cff3a0..801f08db 100644 --- a/api/src/main/java/echopraxia/api/Condition.java +++ b/logging/src/main/java/echopraxia/logging/api/Condition.java @@ -1,5 +1,7 @@ -package echopraxia.api; +package echopraxia.logging.api; +import echopraxia.api.Field; +import echopraxia.api.Value; import java.util.List; import java.util.function.Predicate; import org.jetbrains.annotations.Contract; diff --git a/api/src/main/java/echopraxia/api/Level.java b/logging/src/main/java/echopraxia/logging/api/Level.java similarity index 95% rename from api/src/main/java/echopraxia/api/Level.java rename to logging/src/main/java/echopraxia/logging/api/Level.java index 73de2ba1..c3dbd07d 100644 --- a/api/src/main/java/echopraxia/api/Level.java +++ b/logging/src/main/java/echopraxia/logging/api/Level.java @@ -1,4 +1,4 @@ -package echopraxia.api; +package echopraxia.logging.api; /** * An enumeration of the logging levels. diff --git a/api/src/main/java/echopraxia/api/LoggerHandle.java b/logging/src/main/java/echopraxia/logging/api/LoggerHandle.java similarity index 89% rename from api/src/main/java/echopraxia/api/LoggerHandle.java rename to logging/src/main/java/echopraxia/logging/api/LoggerHandle.java index ed3f3a80..8fd2d45f 100644 --- a/api/src/main/java/echopraxia/api/LoggerHandle.java +++ b/logging/src/main/java/echopraxia/logging/api/LoggerHandle.java @@ -1,5 +1,6 @@ -package echopraxia.api; +package echopraxia.logging.api; +import echopraxia.api.FieldBuilderResult; import java.util.function.Function; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/api/src/main/java/echopraxia/api/LoggingContext.java b/logging/src/main/java/echopraxia/logging/api/LoggingContext.java similarity index 86% rename from api/src/main/java/echopraxia/api/LoggingContext.java rename to logging/src/main/java/echopraxia/logging/api/LoggingContext.java index 7240110f..0e04543e 100644 --- a/api/src/main/java/echopraxia/api/LoggingContext.java +++ b/logging/src/main/java/echopraxia/logging/api/LoggingContext.java @@ -1,7 +1,8 @@ -package echopraxia.api; +package echopraxia.logging.api; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.FindPathMethods; +import echopraxia.api.Field; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.FindPathMethods; import java.util.List; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/api/src/main/java/echopraxia/spi/AbstractEchopraxiaService.java b/logging/src/main/java/echopraxia/logging/spi/AbstractEchopraxiaService.java similarity index 94% rename from api/src/main/java/echopraxia/spi/AbstractEchopraxiaService.java rename to logging/src/main/java/echopraxia/logging/spi/AbstractEchopraxiaService.java index 03ab8cfb..4c079cfa 100644 --- a/api/src/main/java/echopraxia/spi/AbstractEchopraxiaService.java +++ b/logging/src/main/java/echopraxia/logging/spi/AbstractEchopraxiaService.java @@ -1,6 +1,6 @@ -package echopraxia.spi; +package echopraxia.logging.spi; -import echopraxia.api.*; +import echopraxia.api.DefaultToStringFormatter; import echopraxia.api.ToStringFormatter; import java.util.Collections; import org.jetbrains.annotations.NotNull; diff --git a/api/src/main/java/echopraxia/spi/AbstractJsonPathFinder.java b/logging/src/main/java/echopraxia/logging/spi/AbstractJsonPathFinder.java similarity index 98% rename from api/src/main/java/echopraxia/spi/AbstractJsonPathFinder.java rename to logging/src/main/java/echopraxia/logging/spi/AbstractJsonPathFinder.java index 48c88421..6deb27f3 100644 --- a/api/src/main/java/echopraxia/spi/AbstractJsonPathFinder.java +++ b/logging/src/main/java/echopraxia/logging/spi/AbstractJsonPathFinder.java @@ -1,6 +1,6 @@ -package echopraxia.spi; +package echopraxia.logging.spi; -import static echopraxia.spi.FieldConstants.*; +import static echopraxia.api.FieldConstants.*; import com.jayway.jsonpath.*; import com.jayway.jsonpath.spi.json.JsonProvider; diff --git a/api/src/main/java/echopraxia/spi/AbstractLoggerSupport.java b/logging/src/main/java/echopraxia/logging/spi/AbstractLoggerSupport.java similarity index 97% rename from api/src/main/java/echopraxia/spi/AbstractLoggerSupport.java rename to logging/src/main/java/echopraxia/logging/spi/AbstractLoggerSupport.java index f558553f..19d0d8f5 100644 --- a/api/src/main/java/echopraxia/spi/AbstractLoggerSupport.java +++ b/logging/src/main/java/echopraxia/logging/spi/AbstractLoggerSupport.java @@ -1,8 +1,7 @@ -package echopraxia.spi; +package echopraxia.logging.spi; -import echopraxia.api.*; -import echopraxia.api.Condition; import echopraxia.api.FieldBuilderResult; +import echopraxia.logging.api.Condition; import java.util.function.Function; import org.jetbrains.annotations.NotNull; diff --git a/api/src/main/java/echopraxia/spi/Caller.java b/logging/src/main/java/echopraxia/logging/spi/Caller.java similarity index 96% rename from api/src/main/java/echopraxia/spi/Caller.java rename to logging/src/main/java/echopraxia/logging/spi/Caller.java index 06b15f67..4432d474 100644 --- a/api/src/main/java/echopraxia/spi/Caller.java +++ b/logging/src/main/java/echopraxia/logging/spi/Caller.java @@ -1,4 +1,4 @@ -package echopraxia.spi; +package echopraxia.logging.spi; import org.jetbrains.annotations.NotNull; diff --git a/api/src/main/java/echopraxia/spi/CoreLogger.java b/logging/src/main/java/echopraxia/logging/spi/CoreLogger.java similarity index 98% rename from api/src/main/java/echopraxia/spi/CoreLogger.java rename to logging/src/main/java/echopraxia/logging/spi/CoreLogger.java index 4e0a8ee6..6700ae66 100644 --- a/api/src/main/java/echopraxia/spi/CoreLogger.java +++ b/logging/src/main/java/echopraxia/logging/spi/CoreLogger.java @@ -1,6 +1,9 @@ -package echopraxia.spi; +package echopraxia.logging.spi; import echopraxia.api.*; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggerHandle; import java.util.List; import java.util.Map; import java.util.concurrent.Executor; diff --git a/api/src/main/java/echopraxia/spi/CoreLoggerFactory.java b/logging/src/main/java/echopraxia/logging/spi/CoreLoggerFactory.java similarity index 96% rename from api/src/main/java/echopraxia/spi/CoreLoggerFactory.java rename to logging/src/main/java/echopraxia/logging/spi/CoreLoggerFactory.java index 675f1035..ed1f8a66 100644 --- a/api/src/main/java/echopraxia/spi/CoreLoggerFactory.java +++ b/logging/src/main/java/echopraxia/logging/spi/CoreLoggerFactory.java @@ -1,4 +1,4 @@ -package echopraxia.spi; +package echopraxia.logging.spi; import org.jetbrains.annotations.NotNull; diff --git a/api/src/main/java/echopraxia/spi/CoreLoggerFilter.java b/logging/src/main/java/echopraxia/logging/spi/CoreLoggerFilter.java similarity index 92% rename from api/src/main/java/echopraxia/spi/CoreLoggerFilter.java rename to logging/src/main/java/echopraxia/logging/spi/CoreLoggerFilter.java index 0c630522..9cad6f70 100644 --- a/api/src/main/java/echopraxia/spi/CoreLoggerFilter.java +++ b/logging/src/main/java/echopraxia/logging/spi/CoreLoggerFilter.java @@ -1,4 +1,4 @@ -package echopraxia.spi; +package echopraxia.logging.spi; import java.util.function.Function; diff --git a/api/src/main/java/echopraxia/spi/DefaultMethodsSupport.java b/logging/src/main/java/echopraxia/logging/spi/DefaultMethodsSupport.java similarity index 94% rename from api/src/main/java/echopraxia/spi/DefaultMethodsSupport.java rename to logging/src/main/java/echopraxia/logging/spi/DefaultMethodsSupport.java index 9a40ac6b..f66c3685 100644 --- a/api/src/main/java/echopraxia/spi/DefaultMethodsSupport.java +++ b/logging/src/main/java/echopraxia/logging/spi/DefaultMethodsSupport.java @@ -1,4 +1,4 @@ -package echopraxia.spi; +package echopraxia.logging.spi; import org.jetbrains.annotations.NotNull; diff --git a/api/src/main/java/echopraxia/spi/DelegateCoreLogger.java b/logging/src/main/java/echopraxia/logging/spi/DelegateCoreLogger.java similarity index 97% rename from api/src/main/java/echopraxia/spi/DelegateCoreLogger.java rename to logging/src/main/java/echopraxia/logging/spi/DelegateCoreLogger.java index a3c23ef0..6c88f62c 100644 --- a/api/src/main/java/echopraxia/spi/DelegateCoreLogger.java +++ b/logging/src/main/java/echopraxia/logging/spi/DelegateCoreLogger.java @@ -1,6 +1,9 @@ -package echopraxia.spi; +package echopraxia.logging.spi; import echopraxia.api.*; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggerHandle; import java.util.List; import java.util.Map; import java.util.concurrent.Executor; diff --git a/api/src/main/java/echopraxia/spi/EchopraxiaJsonProvider.java b/logging/src/main/java/echopraxia/logging/spi/EchopraxiaJsonProvider.java similarity index 98% rename from api/src/main/java/echopraxia/spi/EchopraxiaJsonProvider.java rename to logging/src/main/java/echopraxia/logging/spi/EchopraxiaJsonProvider.java index d254f2eb..e3784b0a 100644 --- a/api/src/main/java/echopraxia/spi/EchopraxiaJsonProvider.java +++ b/logging/src/main/java/echopraxia/logging/spi/EchopraxiaJsonProvider.java @@ -1,12 +1,12 @@ -package echopraxia.spi; +package echopraxia.logging.spi; import com.jayway.jsonpath.InvalidJsonException; import com.jayway.jsonpath.JsonPathException; import com.jayway.jsonpath.spi.json.JsonProvider; -import echopraxia.api.*; import echopraxia.api.Field; -import echopraxia.api.LoggingContext; +import echopraxia.api.FieldConstants; import echopraxia.api.Value; +import echopraxia.logging.api.LoggingContext; import java.io.InputStream; import java.util.*; import java.util.stream.Collectors; diff --git a/api/src/main/java/echopraxia/spi/EchopraxiaMappingProvider.java b/logging/src/main/java/echopraxia/logging/spi/EchopraxiaMappingProvider.java similarity index 98% rename from api/src/main/java/echopraxia/spi/EchopraxiaMappingProvider.java rename to logging/src/main/java/echopraxia/logging/spi/EchopraxiaMappingProvider.java index ade47a72..0a181969 100644 --- a/api/src/main/java/echopraxia/spi/EchopraxiaMappingProvider.java +++ b/logging/src/main/java/echopraxia/logging/spi/EchopraxiaMappingProvider.java @@ -1,12 +1,12 @@ -package echopraxia.spi; +package echopraxia.logging.spi; import com.jayway.jsonpath.Configuration; import com.jayway.jsonpath.JsonPathException; import com.jayway.jsonpath.TypeRef; import com.jayway.jsonpath.spi.mapper.MappingException; import com.jayway.jsonpath.spi.mapper.MappingProvider; -import echopraxia.api.*; import echopraxia.api.Field; +import echopraxia.api.FieldConstants; import echopraxia.api.Value; import java.util.*; import org.jetbrains.annotations.NotNull; diff --git a/api/src/main/java/echopraxia/spi/EchopraxiaService.java b/logging/src/main/java/echopraxia/logging/spi/EchopraxiaService.java similarity index 98% rename from api/src/main/java/echopraxia/spi/EchopraxiaService.java rename to logging/src/main/java/echopraxia/logging/spi/EchopraxiaService.java index e3888505..bbc4a4a2 100644 --- a/api/src/main/java/echopraxia/spi/EchopraxiaService.java +++ b/logging/src/main/java/echopraxia/logging/spi/EchopraxiaService.java @@ -1,4 +1,4 @@ -package echopraxia.spi; +package echopraxia.logging.spi; import java.util.Iterator; import java.util.ServiceConfigurationError; diff --git a/api/src/main/java/echopraxia/spi/EchopraxiaServiceProvider.java b/logging/src/main/java/echopraxia/logging/spi/EchopraxiaServiceProvider.java similarity index 78% rename from api/src/main/java/echopraxia/spi/EchopraxiaServiceProvider.java rename to logging/src/main/java/echopraxia/logging/spi/EchopraxiaServiceProvider.java index a74cf058..6e5ba99a 100644 --- a/api/src/main/java/echopraxia/spi/EchopraxiaServiceProvider.java +++ b/logging/src/main/java/echopraxia/logging/spi/EchopraxiaServiceProvider.java @@ -1,4 +1,4 @@ -package echopraxia.spi; +package echopraxia.logging.spi; /** * @since 3.0 diff --git a/api/src/main/java/echopraxia/spi/ExceptionHandler.java b/logging/src/main/java/echopraxia/logging/spi/ExceptionHandler.java similarity index 72% rename from api/src/main/java/echopraxia/spi/ExceptionHandler.java rename to logging/src/main/java/echopraxia/logging/spi/ExceptionHandler.java index d626fb26..3969ff58 100644 --- a/api/src/main/java/echopraxia/spi/ExceptionHandler.java +++ b/logging/src/main/java/echopraxia/logging/spi/ExceptionHandler.java @@ -1,4 +1,4 @@ -package echopraxia.spi; +package echopraxia.logging.spi; public interface ExceptionHandler { diff --git a/api/src/main/java/echopraxia/spi/Filters.java b/logging/src/main/java/echopraxia/logging/spi/Filters.java similarity index 99% rename from api/src/main/java/echopraxia/spi/Filters.java rename to logging/src/main/java/echopraxia/logging/spi/Filters.java index 151585b4..246f930d 100644 --- a/api/src/main/java/echopraxia/spi/Filters.java +++ b/logging/src/main/java/echopraxia/logging/spi/Filters.java @@ -1,4 +1,4 @@ -package echopraxia.spi; +package echopraxia.logging.spi; import java.io.IOException; import java.io.InputStream; diff --git a/api/src/main/java/echopraxia/spi/FindPathMethods.java b/logging/src/main/java/echopraxia/logging/spi/FindPathMethods.java similarity index 98% rename from api/src/main/java/echopraxia/spi/FindPathMethods.java rename to logging/src/main/java/echopraxia/logging/spi/FindPathMethods.java index acc504f7..5b53f11f 100644 --- a/api/src/main/java/echopraxia/spi/FindPathMethods.java +++ b/logging/src/main/java/echopraxia/logging/spi/FindPathMethods.java @@ -1,4 +1,4 @@ -package echopraxia.spi; +package echopraxia.logging.spi; import java.util.List; import java.util.Map; diff --git a/api/src/main/java/echopraxia/spi/LoggerContext.java b/logging/src/main/java/echopraxia/logging/spi/LoggerContext.java similarity index 84% rename from api/src/main/java/echopraxia/spi/LoggerContext.java rename to logging/src/main/java/echopraxia/logging/spi/LoggerContext.java index 75534633..2df36cbf 100644 --- a/api/src/main/java/echopraxia/spi/LoggerContext.java +++ b/logging/src/main/java/echopraxia/logging/spi/LoggerContext.java @@ -1,4 +1,4 @@ -package echopraxia.spi; +package echopraxia.logging.spi; import echopraxia.api.Field; import java.util.List; diff --git a/api/src/main/java/echopraxia/spi/Utilities.java b/logging/src/main/java/echopraxia/logging/spi/Utilities.java similarity index 98% rename from api/src/main/java/echopraxia/spi/Utilities.java rename to logging/src/main/java/echopraxia/logging/spi/Utilities.java index c35d989b..9c168067 100644 --- a/api/src/main/java/echopraxia/spi/Utilities.java +++ b/logging/src/main/java/echopraxia/logging/spi/Utilities.java @@ -1,6 +1,5 @@ -package echopraxia.spi; +package echopraxia.logging.spi; -import echopraxia.api.*; import echopraxia.api.Field; import echopraxia.api.Value; import java.util.ArrayList; diff --git a/api/src/test/java/echopraxia/api/ConditionTests.java b/logging/src/test/java/echopraxia/logging/api/ConditionTests.java similarity index 93% rename from api/src/test/java/echopraxia/api/ConditionTests.java rename to logging/src/test/java/echopraxia/logging/api/ConditionTests.java index 50d13fcd..ce86dfe0 100644 --- a/api/src/test/java/echopraxia/api/ConditionTests.java +++ b/logging/src/test/java/echopraxia/logging/api/ConditionTests.java @@ -1,10 +1,12 @@ -package echopraxia.api; +package echopraxia.logging.api; import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.fake.FakeCoreLogger; -import echopraxia.fake.FakeLoggingContext; -import echopraxia.spi.CoreLogger; +import echopraxia.api.Field; +import echopraxia.api.FieldBuilder; +import echopraxia.logging.fake.FakeCoreLogger; +import echopraxia.logging.fake.FakeLoggingContext; +import echopraxia.logging.spi.CoreLogger; import org.junit.jupiter.api.Test; public class ConditionTests { diff --git a/api/src/test/java/echopraxia/api/FilterTests.java b/logging/src/test/java/echopraxia/logging/api/FilterTests.java similarity index 85% rename from api/src/test/java/echopraxia/api/FilterTests.java rename to logging/src/test/java/echopraxia/logging/api/FilterTests.java index 5dbd822b..6c39be83 100644 --- a/api/src/test/java/echopraxia/api/FilterTests.java +++ b/logging/src/test/java/echopraxia/logging/api/FilterTests.java @@ -1,9 +1,10 @@ -package echopraxia.api; +package echopraxia.logging.api; import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.CoreLoggerFactory; +import echopraxia.api.Field; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.CoreLoggerFactory; import java.util.List; import java.util.concurrent.atomic.AtomicReference; import org.junit.jupiter.api.Test; diff --git a/api/src/test/java/echopraxia/api/JsonPathTests.java b/logging/src/test/java/echopraxia/logging/api/JsonPathTests.java similarity index 96% rename from api/src/test/java/echopraxia/api/JsonPathTests.java rename to logging/src/test/java/echopraxia/logging/api/JsonPathTests.java index 80649a81..df7f3661 100644 --- a/api/src/test/java/echopraxia/api/JsonPathTests.java +++ b/logging/src/test/java/echopraxia/logging/api/JsonPathTests.java @@ -1,4 +1,4 @@ -package echopraxia.api; +package echopraxia.logging.api; import static com.jayway.jsonpath.Criteria.where; import static com.jayway.jsonpath.Filter.filter; @@ -7,10 +7,13 @@ import com.jayway.jsonpath.*; import com.jayway.jsonpath.spi.json.JsonProvider; import com.jayway.jsonpath.spi.mapper.MappingProvider; -import echopraxia.fake.FakeCoreLogger; -import echopraxia.fake.FakeLoggingContext; -import echopraxia.spi.EchopraxiaJsonProvider; -import echopraxia.spi.EchopraxiaMappingProvider; +import echopraxia.api.Field; +import echopraxia.api.FieldBuilder; +import echopraxia.api.Value; +import echopraxia.logging.fake.FakeCoreLogger; +import echopraxia.logging.fake.FakeLoggingContext; +import echopraxia.logging.spi.EchopraxiaJsonProvider; +import echopraxia.logging.spi.EchopraxiaMappingProvider; import java.util.List; import java.util.Optional; import org.junit.jupiter.api.Test; diff --git a/api/src/test/java/echopraxia/api/LevelTests.java b/logging/src/test/java/echopraxia/logging/api/LevelTests.java similarity index 97% rename from api/src/test/java/echopraxia/api/LevelTests.java rename to logging/src/test/java/echopraxia/logging/api/LevelTests.java index 4cdc81a2..a2f8bb22 100644 --- a/api/src/test/java/echopraxia/api/LevelTests.java +++ b/logging/src/test/java/echopraxia/logging/api/LevelTests.java @@ -1,4 +1,4 @@ -package echopraxia.api; +package echopraxia.logging.api; import static org.assertj.core.api.Assertions.assertThat; diff --git a/api/src/test/java/echopraxia/api/TestFilter.java b/logging/src/test/java/echopraxia/logging/api/TestFilter.java similarity index 60% rename from api/src/test/java/echopraxia/api/TestFilter.java rename to logging/src/test/java/echopraxia/logging/api/TestFilter.java index 35ee452e..62e73329 100644 --- a/api/src/test/java/echopraxia/api/TestFilter.java +++ b/logging/src/test/java/echopraxia/logging/api/TestFilter.java @@ -1,7 +1,8 @@ -package echopraxia.api; +package echopraxia.logging.api; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.CoreLoggerFilter; +import echopraxia.api.FieldBuilder; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.CoreLoggerFilter; public class TestFilter implements CoreLoggerFilter { @Override diff --git a/logging/src/test/resources/echopraxia.properties b/logging/src/test/resources/echopraxia.properties new file mode 100644 index 00000000..89c09e77 --- /dev/null +++ b/logging/src/test/resources/echopraxia.properties @@ -0,0 +1 @@ +filter.0=echopraxia.logging.api.TestFilter \ No newline at end of file diff --git a/api/src/testFixtures/java/echopraxia/fake/FakeCoreLogger.java b/logging/src/testFixtures/java/echopraxia/logging/fake/FakeCoreLogger.java similarity index 97% rename from api/src/testFixtures/java/echopraxia/fake/FakeCoreLogger.java rename to logging/src/testFixtures/java/echopraxia/logging/fake/FakeCoreLogger.java index 2b84a43d..d1c678ff 100644 --- a/api/src/testFixtures/java/echopraxia/fake/FakeCoreLogger.java +++ b/logging/src/testFixtures/java/echopraxia/logging/fake/FakeCoreLogger.java @@ -1,10 +1,13 @@ -package echopraxia.fake; +package echopraxia.logging.fake; -import static echopraxia.spi.Utilities.joinFields; +import static echopraxia.logging.spi.Utilities.joinFields; import echopraxia.api.*; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.LoggerContext; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggerHandle; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.LoggerContext; import java.util.Collections; import java.util.List; import java.util.Map; diff --git a/api/src/testFixtures/java/echopraxia/fake/FakeEchopraxiaService.java b/logging/src/testFixtures/java/echopraxia/logging/fake/FakeEchopraxiaService.java similarity index 77% rename from api/src/testFixtures/java/echopraxia/fake/FakeEchopraxiaService.java rename to logging/src/testFixtures/java/echopraxia/logging/fake/FakeEchopraxiaService.java index 0bcff5ad..3636b8c6 100644 --- a/api/src/testFixtures/java/echopraxia/fake/FakeEchopraxiaService.java +++ b/logging/src/testFixtures/java/echopraxia/logging/fake/FakeEchopraxiaService.java @@ -1,7 +1,7 @@ -package echopraxia.fake; +package echopraxia.logging.fake; -import echopraxia.spi.AbstractEchopraxiaService; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.spi.AbstractEchopraxiaService; +import echopraxia.logging.spi.CoreLogger; import org.jetbrains.annotations.NotNull; public class FakeEchopraxiaService extends AbstractEchopraxiaService { diff --git a/api/src/testFixtures/java/echopraxia/fake/FakeEchopraxiaServiceProvider.java b/logging/src/testFixtures/java/echopraxia/logging/fake/FakeEchopraxiaServiceProvider.java similarity index 58% rename from api/src/testFixtures/java/echopraxia/fake/FakeEchopraxiaServiceProvider.java rename to logging/src/testFixtures/java/echopraxia/logging/fake/FakeEchopraxiaServiceProvider.java index 6a9048fd..32a2d547 100644 --- a/api/src/testFixtures/java/echopraxia/fake/FakeEchopraxiaServiceProvider.java +++ b/logging/src/testFixtures/java/echopraxia/logging/fake/FakeEchopraxiaServiceProvider.java @@ -1,7 +1,7 @@ -package echopraxia.fake; +package echopraxia.logging.fake; -import echopraxia.spi.EchopraxiaService; -import echopraxia.spi.EchopraxiaServiceProvider; +import echopraxia.logging.spi.EchopraxiaService; +import echopraxia.logging.spi.EchopraxiaServiceProvider; public class FakeEchopraxiaServiceProvider implements EchopraxiaServiceProvider { diff --git a/api/src/testFixtures/java/echopraxia/fake/FakeLoggerContext.java b/logging/src/testFixtures/java/echopraxia/logging/fake/FakeLoggerContext.java similarity index 79% rename from api/src/testFixtures/java/echopraxia/fake/FakeLoggerContext.java rename to logging/src/testFixtures/java/echopraxia/logging/fake/FakeLoggerContext.java index 77feac43..52865ce7 100644 --- a/api/src/testFixtures/java/echopraxia/fake/FakeLoggerContext.java +++ b/logging/src/testFixtures/java/echopraxia/logging/fake/FakeLoggerContext.java @@ -1,10 +1,10 @@ -package echopraxia.fake; +package echopraxia.logging.fake; -import static echopraxia.spi.Utilities.joinFields; -import static echopraxia.spi.Utilities.memoize; +import static echopraxia.logging.spi.Utilities.joinFields; +import static echopraxia.logging.spi.Utilities.memoize; import echopraxia.api.Field; -import echopraxia.spi.LoggerContext; +import echopraxia.logging.spi.LoggerContext; import java.util.Collections; import java.util.List; import java.util.function.Supplier; diff --git a/api/src/testFixtures/java/echopraxia/fake/FakeLoggingContext.java b/logging/src/testFixtures/java/echopraxia/logging/fake/FakeLoggingContext.java similarity index 94% rename from api/src/testFixtures/java/echopraxia/fake/FakeLoggingContext.java rename to logging/src/testFixtures/java/echopraxia/logging/fake/FakeLoggingContext.java index d10afabd..72233573 100644 --- a/api/src/testFixtures/java/echopraxia/fake/FakeLoggingContext.java +++ b/logging/src/testFixtures/java/echopraxia/logging/fake/FakeLoggingContext.java @@ -1,9 +1,9 @@ -package echopraxia.fake; +package echopraxia.logging.fake; import echopraxia.api.Field; -import echopraxia.api.LoggingContext; -import echopraxia.spi.AbstractJsonPathFinder; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.api.LoggingContext; +import echopraxia.logging.spi.AbstractJsonPathFinder; +import echopraxia.logging.spi.CoreLogger; import java.util.Arrays; import java.util.Collections; import java.util.List; diff --git a/logging/src/testFixtures/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider b/logging/src/testFixtures/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider new file mode 100644 index 00000000..05fe1c47 --- /dev/null +++ b/logging/src/testFixtures/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider @@ -0,0 +1 @@ +echopraxia.logging.fake.FakeEchopraxiaServiceProvider \ No newline at end of file diff --git a/logstash/src/jmh/java/echopraxia/logstash/AsyncLoggerBenchmarks.java b/logstash/src/jmh/java/echopraxia/logstash/AsyncLoggerBenchmarks.java index 62382b51..f7273dbf 100644 --- a/logstash/src/jmh/java/echopraxia/logstash/AsyncLoggerBenchmarks.java +++ b/logstash/src/jmh/java/echopraxia/logstash/AsyncLoggerBenchmarks.java @@ -1,11 +1,11 @@ package echopraxia.logstash; -import echopraxia.api.Condition; import echopraxia.api.FieldBuilder; -import echopraxia.api.Level; import echopraxia.api.PresentationFieldBuilder; import echopraxia.async.AsyncLogger; import echopraxia.async.AsyncLoggerFactory; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; import java.util.concurrent.Executor; import java.util.concurrent.TimeUnit; import org.jetbrains.annotations.NotNull; diff --git a/logstash/src/jmh/java/echopraxia/logstash/CoreLoggerBenchmarks.java b/logstash/src/jmh/java/echopraxia/logstash/CoreLoggerBenchmarks.java index 4e3eeefa..9fca3b9a 100644 --- a/logstash/src/jmh/java/echopraxia/logstash/CoreLoggerBenchmarks.java +++ b/logstash/src/jmh/java/echopraxia/logstash/CoreLoggerBenchmarks.java @@ -1,9 +1,9 @@ package echopraxia.logstash; import echopraxia.api.FieldBuilder; -import echopraxia.api.Level; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.CoreLoggerFactory; +import echopraxia.logging.api.Level; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.CoreLoggerFactory; import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.infra.Blackhole; diff --git a/logstash/src/jmh/java/echopraxia/logstash/FakeLoggingContext.java b/logstash/src/jmh/java/echopraxia/logstash/FakeLoggingContext.java index a4f9d5bd..71ec46ba 100644 --- a/logstash/src/jmh/java/echopraxia/logstash/FakeLoggingContext.java +++ b/logstash/src/jmh/java/echopraxia/logstash/FakeLoggingContext.java @@ -1,9 +1,9 @@ package echopraxia.logstash; import echopraxia.api.Field; -import echopraxia.api.LoggingContext; -import echopraxia.spi.AbstractJsonPathFinder; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.api.LoggingContext; +import echopraxia.logging.spi.AbstractJsonPathFinder; +import echopraxia.logging.spi.CoreLogger; import java.util.Arrays; import java.util.Collections; import java.util.List; diff --git a/logstash/src/jmh/java/echopraxia/logstash/JsonPathBenchmarks.java b/logstash/src/jmh/java/echopraxia/logstash/JsonPathBenchmarks.java index 14b8fcff..241aed16 100644 --- a/logstash/src/jmh/java/echopraxia/logstash/JsonPathBenchmarks.java +++ b/logstash/src/jmh/java/echopraxia/logstash/JsonPathBenchmarks.java @@ -1,7 +1,9 @@ package echopraxia.logstash; import echopraxia.api.*; -import echopraxia.api.Level; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggingContext; import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.infra.Blackhole; diff --git a/logstash/src/jmh/java/echopraxia/logstash/LoggerBenchmarks.java b/logstash/src/jmh/java/echopraxia/logstash/LoggerBenchmarks.java index 61fc7d22..ab0fa6b5 100644 --- a/logstash/src/jmh/java/echopraxia/logstash/LoggerBenchmarks.java +++ b/logstash/src/jmh/java/echopraxia/logstash/LoggerBenchmarks.java @@ -1,11 +1,10 @@ package echopraxia.logstash; -import echopraxia.*; -import echopraxia.Logger; -import echopraxia.LoggerFactory; -import echopraxia.api.Condition; -import echopraxia.api.Level; import echopraxia.api.PresentationFieldBuilder; +import echopraxia.logger.Logger; +import echopraxia.logger.LoggerFactory; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; import java.util.concurrent.TimeUnit; import org.openjdk.jmh.annotations.*; import org.openjdk.jmh.infra.Blackhole; diff --git a/logstash/src/main/java/echopraxia/logstash/LogstashCoreLogger.java b/logstash/src/main/java/echopraxia/logstash/LogstashCoreLogger.java index 76b09b47..33943070 100644 --- a/logstash/src/main/java/echopraxia/logstash/LogstashCoreLogger.java +++ b/logstash/src/main/java/echopraxia/logstash/LogstashCoreLogger.java @@ -1,6 +1,6 @@ package echopraxia.logstash; -import static echopraxia.spi.Utilities.joinFields; +import static echopraxia.logging.spi.Utilities.joinFields; import static org.slf4j.event.EventConstants.*; import ch.qos.logback.classic.LoggerContext; @@ -8,9 +8,13 @@ import echopraxia.logback.CallerMarker; import echopraxia.logback.LogbackLoggerContext; import echopraxia.logback.LogbackLoggingContext; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.EchopraxiaService; -import echopraxia.spi.Utilities; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggerHandle; +import echopraxia.logging.api.LoggingContext; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.EchopraxiaService; +import echopraxia.logging.spi.Utilities; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; @@ -108,7 +112,7 @@ public String getName() { @Override @NotNull - public echopraxia.spi.LoggerContext getLoggerContext() { + public echopraxia.logging.spi.LoggerContext getLoggerContext() { return context; } diff --git a/logstash/src/main/java/echopraxia/logstash/LogstashEchopraxiaService.java b/logstash/src/main/java/echopraxia/logstash/LogstashEchopraxiaService.java index d319f1f9..1b82318c 100644 --- a/logstash/src/main/java/echopraxia/logstash/LogstashEchopraxiaService.java +++ b/logstash/src/main/java/echopraxia/logstash/LogstashEchopraxiaService.java @@ -1,8 +1,8 @@ package echopraxia.logstash; import ch.qos.logback.classic.LoggerContext; -import echopraxia.spi.AbstractEchopraxiaService; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.spi.AbstractEchopraxiaService; +import echopraxia.logging.spi.CoreLogger; import java.util.ServiceConfigurationError; import org.jetbrains.annotations.NotNull; import org.slf4j.ILoggerFactory; diff --git a/logstash/src/main/java/echopraxia/logstash/LogstashEchopraxiaServiceProvider.java b/logstash/src/main/java/echopraxia/logstash/LogstashEchopraxiaServiceProvider.java index 658a21da..158ae580 100644 --- a/logstash/src/main/java/echopraxia/logstash/LogstashEchopraxiaServiceProvider.java +++ b/logstash/src/main/java/echopraxia/logstash/LogstashEchopraxiaServiceProvider.java @@ -1,7 +1,7 @@ package echopraxia.logstash; -import echopraxia.spi.EchopraxiaService; -import echopraxia.spi.EchopraxiaServiceProvider; +import echopraxia.logging.spi.EchopraxiaService; +import echopraxia.logging.spi.EchopraxiaServiceProvider; public class LogstashEchopraxiaServiceProvider implements EchopraxiaServiceProvider { @Override diff --git a/logstash/src/main/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider b/logstash/src/main/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider similarity index 100% rename from logstash/src/main/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider rename to logstash/src/main/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider diff --git a/logstash/src/test/java/echopraxia/logstash/ConditionTest.java b/logstash/src/test/java/echopraxia/logstash/ConditionTest.java index 860c037c..1a69a73a 100644 --- a/logstash/src/test/java/echopraxia/logstash/ConditionTest.java +++ b/logstash/src/test/java/echopraxia/logstash/ConditionTest.java @@ -7,11 +7,10 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.read.ListAppender; -import echopraxia.*; -import echopraxia.api.Condition; import echopraxia.api.Field; -import echopraxia.api.Level; import echopraxia.api.Value; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; diff --git a/logstash/src/test/java/echopraxia/logstash/ContextTest.java b/logstash/src/test/java/echopraxia/logstash/ContextTest.java index 233301d5..fa15836a 100644 --- a/logstash/src/test/java/echopraxia/logstash/ContextTest.java +++ b/logstash/src/test/java/echopraxia/logstash/ContextTest.java @@ -8,15 +8,14 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.json.JsonMapper; -import echopraxia.*; -import echopraxia.Logger; -import echopraxia.LoggerFactory; -import echopraxia.api.Condition; import echopraxia.api.Field; import echopraxia.api.FieldBuilder; import echopraxia.api.Value; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.CoreLoggerFactory; +import echopraxia.logger.Logger; +import echopraxia.logger.LoggerFactory; +import echopraxia.logging.api.Condition; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.CoreLoggerFactory; import java.io.IOException; import java.io.StringWriter; import java.util.*; diff --git a/logstash/src/test/java/echopraxia/logstash/ConverterTest.java b/logstash/src/test/java/echopraxia/logstash/ConverterTest.java index e906df29..b30b477a 100644 --- a/logstash/src/test/java/echopraxia/logstash/ConverterTest.java +++ b/logstash/src/test/java/echopraxia/logstash/ConverterTest.java @@ -1,7 +1,7 @@ package echopraxia.logstash; import ch.qos.logback.classic.LoggerContext; -import echopraxia.LoggerFactory; +import echopraxia.logger.LoggerFactory; import java.net.MalformedURLException; import java.net.URISyntaxException; import org.junit.jupiter.api.AfterEach; diff --git a/logstash/src/test/java/echopraxia/logstash/DirectTest.java b/logstash/src/test/java/echopraxia/logstash/DirectTest.java index 788a641b..3fe67bce 100644 --- a/logstash/src/test/java/echopraxia/logstash/DirectTest.java +++ b/logstash/src/test/java/echopraxia/logstash/DirectTest.java @@ -11,10 +11,10 @@ import ch.qos.logback.core.Appender; import ch.qos.logback.core.joran.spi.JoranException; import ch.qos.logback.core.read.ListAppender; -import echopraxia.api.Condition; import echopraxia.api.FieldBuilder; import echopraxia.logback.ConditionMarker; import echopraxia.logback.DirectFieldMarker; +import echopraxia.logging.api.Condition; import java.net.MalformedURLException; import java.net.URISyntaxException; import java.util.Iterator; diff --git a/logstash/src/test/java/echopraxia/logstash/ExceptionHandlerTests.java b/logstash/src/test/java/echopraxia/logstash/ExceptionHandlerTests.java index 28060243..36352454 100644 --- a/logstash/src/test/java/echopraxia/logstash/ExceptionHandlerTests.java +++ b/logstash/src/test/java/echopraxia/logstash/ExceptionHandlerTests.java @@ -4,7 +4,7 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.read.ListAppender; -import echopraxia.api.Condition; +import echopraxia.logging.api.Condition; import org.junit.jupiter.api.Test; public class ExceptionHandlerTests extends TestBase { diff --git a/logstash/src/test/java/echopraxia/logstash/LoggerFactoryTest.java b/logstash/src/test/java/echopraxia/logstash/LoggerFactoryTest.java index cd8cfdd0..d5fabe60 100644 --- a/logstash/src/test/java/echopraxia/logstash/LoggerFactoryTest.java +++ b/logstash/src/test/java/echopraxia/logstash/LoggerFactoryTest.java @@ -2,9 +2,9 @@ import static org.assertj.core.api.Assertions.assertThat; -import echopraxia.Logger; -import echopraxia.LoggerFactory; import echopraxia.api.PresentationFieldBuilder; +import echopraxia.logger.Logger; +import echopraxia.logger.LoggerFactory; import org.junit.jupiter.api.Test; public class LoggerFactoryTest { diff --git a/logstash/src/test/java/echopraxia/logstash/LogstashLoggerTest.java b/logstash/src/test/java/echopraxia/logstash/LogstashLoggerTest.java index 5e88e204..05243b64 100644 --- a/logstash/src/test/java/echopraxia/logstash/LogstashLoggerTest.java +++ b/logstash/src/test/java/echopraxia/logstash/LogstashLoggerTest.java @@ -8,11 +8,10 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.json.JsonMapper; -import echopraxia.*; -import echopraxia.Logger; import echopraxia.api.Field; import echopraxia.api.FieldBuilder; import echopraxia.api.Value; +import echopraxia.logger.Logger; import java.io.IOException; import java.io.StringWriter; import java.util.Optional; diff --git a/logstash/src/test/java/echopraxia/logstash/StaticExceptionHandler.java b/logstash/src/test/java/echopraxia/logstash/StaticExceptionHandler.java index b3b61a9f..c23da558 100644 --- a/logstash/src/test/java/echopraxia/logstash/StaticExceptionHandler.java +++ b/logstash/src/test/java/echopraxia/logstash/StaticExceptionHandler.java @@ -1,6 +1,6 @@ package echopraxia.logstash; -import echopraxia.spi.ExceptionHandler; +import echopraxia.logging.spi.ExceptionHandler; import java.util.ArrayList; import java.util.List; diff --git a/logstash/src/test/java/echopraxia/logstash/TestBase.java b/logstash/src/test/java/echopraxia/logstash/TestBase.java index 3035eb53..68546064 100644 --- a/logstash/src/test/java/echopraxia/logstash/TestBase.java +++ b/logstash/src/test/java/echopraxia/logstash/TestBase.java @@ -7,13 +7,12 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.joran.spi.JoranException; import ch.qos.logback.core.read.ListAppender; -import echopraxia.*; -import echopraxia.Logger; -import echopraxia.LoggerFactory; import echopraxia.api.FieldBuilder; import echopraxia.async.AsyncLogger; import echopraxia.async.AsyncLoggerFactory; import echopraxia.logback.TransformingAppender; +import echopraxia.logger.Logger; +import echopraxia.logger.LoggerFactory; import java.net.MalformedURLException; import java.net.URISyntaxException; import org.junit.jupiter.api.BeforeEach; diff --git a/logstash/src/test/java/echopraxia/logstash/TestEchopraxiaServiceProvider.java b/logstash/src/test/java/echopraxia/logstash/TestEchopraxiaServiceProvider.java index ee40e41f..02a6facd 100644 --- a/logstash/src/test/java/echopraxia/logstash/TestEchopraxiaServiceProvider.java +++ b/logstash/src/test/java/echopraxia/logstash/TestEchopraxiaServiceProvider.java @@ -1,7 +1,7 @@ package echopraxia.logstash; -import echopraxia.spi.EchopraxiaService; -import echopraxia.spi.EchopraxiaServiceProvider; +import echopraxia.logging.spi.EchopraxiaService; +import echopraxia.logging.spi.EchopraxiaServiceProvider; public class TestEchopraxiaServiceProvider implements EchopraxiaServiceProvider { @Override diff --git a/logstash/src/test/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider b/logstash/src/test/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider similarity index 100% rename from logstash/src/test/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider rename to logstash/src/test/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider diff --git a/noop/build.gradle b/noop/build.gradle index a9239c20..1fc27214 100644 --- a/noop/build.gradle +++ b/noop/build.gradle @@ -3,5 +3,5 @@ plugins { } dependencies { - api project(":api") + api project(":logging") } diff --git a/noop/src/main/java/echopraxia/noop/NoopCoreLogger.java b/noop/src/main/java/echopraxia/noop/NoopCoreLogger.java index ea561a0d..feee6264 100644 --- a/noop/src/main/java/echopraxia/noop/NoopCoreLogger.java +++ b/noop/src/main/java/echopraxia/noop/NoopCoreLogger.java @@ -1,10 +1,13 @@ package echopraxia.noop; -import static echopraxia.spi.Utilities.joinFields; +import static echopraxia.logging.spi.Utilities.joinFields; import echopraxia.api.*; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.LoggerContext; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggerHandle; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.LoggerContext; import java.util.Collections; import java.util.List; import java.util.Map; diff --git a/noop/src/main/java/echopraxia/noop/NoopEchopraxiaService.java b/noop/src/main/java/echopraxia/noop/NoopEchopraxiaService.java index 1d5bd28a..756b4505 100644 --- a/noop/src/main/java/echopraxia/noop/NoopEchopraxiaService.java +++ b/noop/src/main/java/echopraxia/noop/NoopEchopraxiaService.java @@ -1,7 +1,7 @@ package echopraxia.noop; -import echopraxia.spi.AbstractEchopraxiaService; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.spi.AbstractEchopraxiaService; +import echopraxia.logging.spi.CoreLogger; import org.jetbrains.annotations.NotNull; public class NoopEchopraxiaService extends AbstractEchopraxiaService { diff --git a/noop/src/main/java/echopraxia/noop/NoopEchopraxiaServiceProvider.java b/noop/src/main/java/echopraxia/noop/NoopEchopraxiaServiceProvider.java index 20921258..f8679073 100644 --- a/noop/src/main/java/echopraxia/noop/NoopEchopraxiaServiceProvider.java +++ b/noop/src/main/java/echopraxia/noop/NoopEchopraxiaServiceProvider.java @@ -1,7 +1,7 @@ package echopraxia.noop; -import echopraxia.spi.EchopraxiaService; -import echopraxia.spi.EchopraxiaServiceProvider; +import echopraxia.logging.spi.EchopraxiaService; +import echopraxia.logging.spi.EchopraxiaServiceProvider; public class NoopEchopraxiaServiceProvider implements EchopraxiaServiceProvider { diff --git a/noop/src/main/java/echopraxia/noop/NoopLoggerContext.java b/noop/src/main/java/echopraxia/noop/NoopLoggerContext.java index 17141271..ee65b6fa 100644 --- a/noop/src/main/java/echopraxia/noop/NoopLoggerContext.java +++ b/noop/src/main/java/echopraxia/noop/NoopLoggerContext.java @@ -1,10 +1,10 @@ package echopraxia.noop; -import static echopraxia.spi.Utilities.joinFields; -import static echopraxia.spi.Utilities.memoize; +import static echopraxia.logging.spi.Utilities.joinFields; +import static echopraxia.logging.spi.Utilities.memoize; import echopraxia.api.Field; -import echopraxia.spi.LoggerContext; +import echopraxia.logging.spi.LoggerContext; import java.util.Collections; import java.util.List; import java.util.function.Supplier; diff --git a/noop/src/main/java/echopraxia/noop/NoopLoggingContext.java b/noop/src/main/java/echopraxia/noop/NoopLoggingContext.java index 8176804c..c93e4200 100644 --- a/noop/src/main/java/echopraxia/noop/NoopLoggingContext.java +++ b/noop/src/main/java/echopraxia/noop/NoopLoggingContext.java @@ -1,9 +1,9 @@ package echopraxia.noop; import echopraxia.api.Field; -import echopraxia.api.LoggingContext; -import echopraxia.spi.AbstractJsonPathFinder; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.api.LoggingContext; +import echopraxia.logging.spi.AbstractJsonPathFinder; +import echopraxia.logging.spi.CoreLogger; import java.util.Arrays; import java.util.Collections; import java.util.List; diff --git a/noop/src/main/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider b/noop/src/main/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider similarity index 100% rename from noop/src/main/resources/META-INF/services/echopraxia.spi.EchopraxiaServiceProvider rename to noop/src/main/resources/META-INF/services/echopraxia.logging.spi.EchopraxiaServiceProvider diff --git a/scripting/build.gradle b/scripting/build.gradle index d17d958b..0b77426f 100644 --- a/scripting/build.gradle +++ b/scripting/build.gradle @@ -3,7 +3,7 @@ plugins { } dependencies { - api project(":api") + api project(":logging") implementation project(":filewatch") implementation "com.twineworks:tweakflow:$tweakflowVersion" diff --git a/scripting/src/jmh/java/echopraxia/scripting/FakeLoggingContext.java b/scripting/src/jmh/java/echopraxia/scripting/FakeLoggingContext.java index 1fbcb4a0..875b0736 100644 --- a/scripting/src/jmh/java/echopraxia/scripting/FakeLoggingContext.java +++ b/scripting/src/jmh/java/echopraxia/scripting/FakeLoggingContext.java @@ -1,9 +1,9 @@ package echopraxia.scripting; import echopraxia.api.Field; -import echopraxia.api.LoggingContext; -import echopraxia.spi.AbstractJsonPathFinder; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.api.LoggingContext; +import echopraxia.logging.spi.AbstractJsonPathFinder; +import echopraxia.logging.spi.CoreLogger; import java.util.Arrays; import java.util.Collections; import java.util.List; diff --git a/scripting/src/jmh/java/echopraxia/scripting/ScriptingBenchmarks.java b/scripting/src/jmh/java/echopraxia/scripting/ScriptingBenchmarks.java index 5ac288ef..c6118f62 100644 --- a/scripting/src/jmh/java/echopraxia/scripting/ScriptingBenchmarks.java +++ b/scripting/src/jmh/java/echopraxia/scripting/ScriptingBenchmarks.java @@ -1,7 +1,9 @@ package echopraxia.scripting; import echopraxia.api.*; -import echopraxia.api.Level; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggingContext; import java.nio.file.Path; import java.nio.file.Paths; import java.util.concurrent.TimeUnit; diff --git a/scripting/src/main/java/echopraxia/scripting/ScriptCondition.java b/scripting/src/main/java/echopraxia/scripting/ScriptCondition.java index 8a58e245..536fc68a 100644 --- a/scripting/src/main/java/echopraxia/scripting/ScriptCondition.java +++ b/scripting/src/main/java/echopraxia/scripting/ScriptCondition.java @@ -1,8 +1,8 @@ package echopraxia.scripting; -import echopraxia.api.Condition; -import echopraxia.api.Level; -import echopraxia.api.LoggingContext; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggingContext; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/scripting/src/main/java/echopraxia/scripting/ScriptManager.java b/scripting/src/main/java/echopraxia/scripting/ScriptManager.java index 4f1be365..d1b39c08 100644 --- a/scripting/src/main/java/echopraxia/scripting/ScriptManager.java +++ b/scripting/src/main/java/echopraxia/scripting/ScriptManager.java @@ -8,8 +8,8 @@ import com.twineworks.tweakflow.lang.runtime.Runtime; import com.twineworks.tweakflow.lang.types.Types; import com.twineworks.tweakflow.lang.values.*; -import echopraxia.api.Level; -import echopraxia.api.LoggingContext; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggingContext; import java.util.*; import java.util.function.Function; diff --git a/scripting/src/test/java/echopraxia/scripting/FakeLoggingContext.java b/scripting/src/test/java/echopraxia/scripting/FakeLoggingContext.java index 1fbcb4a0..875b0736 100644 --- a/scripting/src/test/java/echopraxia/scripting/FakeLoggingContext.java +++ b/scripting/src/test/java/echopraxia/scripting/FakeLoggingContext.java @@ -1,9 +1,9 @@ package echopraxia.scripting; import echopraxia.api.Field; -import echopraxia.api.LoggingContext; -import echopraxia.spi.AbstractJsonPathFinder; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.api.LoggingContext; +import echopraxia.logging.spi.AbstractJsonPathFinder; +import echopraxia.logging.spi.CoreLogger; import java.util.Arrays; import java.util.Collections; import java.util.List; diff --git a/scripting/src/test/java/echopraxia/scripting/Main.java b/scripting/src/test/java/echopraxia/scripting/Main.java index 0426a2be..993b9177 100644 --- a/scripting/src/test/java/echopraxia/scripting/Main.java +++ b/scripting/src/test/java/echopraxia/scripting/Main.java @@ -1,11 +1,11 @@ package echopraxia.scripting; -import static echopraxia.api.Level.INFO; +import static echopraxia.logging.api.Level.INFO; -import echopraxia.api.Condition; import echopraxia.api.Field; -import echopraxia.api.LoggingContext; import echopraxia.api.Value; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.LoggingContext; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; diff --git a/scripting/src/test/java/echopraxia/scripting/ScriptConditionTest.java b/scripting/src/test/java/echopraxia/scripting/ScriptConditionTest.java index 1a48ff78..80005de8 100644 --- a/scripting/src/test/java/echopraxia/scripting/ScriptConditionTest.java +++ b/scripting/src/test/java/echopraxia/scripting/ScriptConditionTest.java @@ -10,10 +10,10 @@ import com.twineworks.tweakflow.lang.types.Types; import com.twineworks.tweakflow.lang.values.FunctionParameter; import com.twineworks.tweakflow.lang.values.Values; -import echopraxia.LoggerFactory; -import echopraxia.api.Condition; import echopraxia.api.Field; -import echopraxia.api.LoggingContext; +import echopraxia.logger.LoggerFactory; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.LoggingContext; import echopraxia.logstash.LogstashCoreLogger; import java.nio.file.Path; import java.nio.file.Paths; diff --git a/scripting/src/test/java/echopraxia/scripting/ScriptManagerTest.java b/scripting/src/test/java/echopraxia/scripting/ScriptManagerTest.java index 55724a8a..5630639a 100644 --- a/scripting/src/test/java/echopraxia/scripting/ScriptManagerTest.java +++ b/scripting/src/test/java/echopraxia/scripting/ScriptManagerTest.java @@ -4,8 +4,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.awaitility.Awaitility.await; -import echopraxia.api.Level; -import echopraxia.api.LoggingContext; +import echopraxia.logging.api.Level; +import echopraxia.logging.api.LoggingContext; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; diff --git a/semantic/build.gradle b/semantic/build.gradle index 6d34e9a9..6416ed09 100644 --- a/semantic/build.gradle +++ b/semantic/build.gradle @@ -3,7 +3,7 @@ plugins { } dependencies { - api project(":api") + api project(":logging") jmhImplementation project(":logstash") diff --git a/semantic/src/main/java/echopraxia/semantic/SemanticLogger.java b/semantic/src/main/java/echopraxia/semantic/SemanticLogger.java index 9d79a901..ca64b16d 100644 --- a/semantic/src/main/java/echopraxia/semantic/SemanticLogger.java +++ b/semantic/src/main/java/echopraxia/semantic/SemanticLogger.java @@ -1,9 +1,8 @@ package echopraxia.semantic; -import echopraxia.api.*; -import echopraxia.api.Condition; import echopraxia.api.FieldBuilderResult; -import echopraxia.spi.CoreLogger; +import echopraxia.logging.api.Condition; +import echopraxia.logging.spi.CoreLogger; import java.util.function.Function; import org.jetbrains.annotations.NotNull; diff --git a/semantic/src/main/java/echopraxia/semantic/SemanticLoggerFactory.java b/semantic/src/main/java/echopraxia/semantic/SemanticLoggerFactory.java index f5935df5..897282bb 100644 --- a/semantic/src/main/java/echopraxia/semantic/SemanticLoggerFactory.java +++ b/semantic/src/main/java/echopraxia/semantic/SemanticLoggerFactory.java @@ -1,14 +1,13 @@ package echopraxia.semantic; -import echopraxia.api.*; -import echopraxia.api.Condition; import echopraxia.api.FieldBuilderResult; -import echopraxia.api.Level; import echopraxia.api.PresentationFieldBuilder; -import echopraxia.spi.Caller; -import echopraxia.spi.CoreLogger; -import echopraxia.spi.CoreLoggerFactory; -import echopraxia.spi.Utilities; +import echopraxia.logging.api.Condition; +import echopraxia.logging.api.Level; +import echopraxia.logging.spi.Caller; +import echopraxia.logging.spi.CoreLogger; +import echopraxia.logging.spi.CoreLoggerFactory; +import echopraxia.logging.spi.Utilities; import java.util.function.Function; import org.jetbrains.annotations.NotNull; diff --git a/semantic/src/test/java/echopraxia/semantic/SemanticLoggerTest.java b/semantic/src/test/java/echopraxia/semantic/SemanticLoggerTest.java index 9cc6ae4e..b1caa522 100644 --- a/semantic/src/test/java/echopraxia/semantic/SemanticLoggerTest.java +++ b/semantic/src/test/java/echopraxia/semantic/SemanticLoggerTest.java @@ -7,9 +7,9 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.read.ListAppender; import echopraxia.api.FieldBuilder; +import echopraxia.logging.spi.Caller; +import echopraxia.logging.spi.CoreLoggerFactory; import echopraxia.logstash.LogstashCoreLogger; -import echopraxia.spi.Caller; -import echopraxia.spi.CoreLoggerFactory; import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/settings.gradle b/settings.gradle index e992f0b8..4b606d4d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -8,6 +8,7 @@ include('jackson') include('jul') include('noop') +include('logging') include('logger') include('async') include('scripting')