Sync 'dev' branch#8
Merged
Merged
Conversation
Refactor logging module names and related artifacts: microsphere-logging-core -> microsphere-logging-commons, microsphere-logging-jdk -> microsphere-java-logging, microsphere-logging-logback -> microsphere-logback, and microsphere-logging-log4j2 -> microsphere-log4j2. Update POMs and inter-module dependencies to use the new artifactIds. Rename JDKLogging class and tests to JavaLogging (and adjust references), update the service provider file accordingly (remove old JDK entry, add JavaLogging entry). Update parent modules list and logging-dependencies / test POMs to reflect the new module names.
Update module list and dependency example to reflect refactored module names: replace microsphere-logging-core with microsphere-logging-commons, microsphere-logging-jdk with microsphere-java-logging, and rename microsphere-logging-logback/log4j2 to microsphere-logback/microsphere-log4j2. Adjust the sample dependency artifactId accordingly to keep documentation consistent with the project changes.
🤖 Augment PR SummarySummary: This PR syncs the Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
Introduce LoggingUtils.load() and load(ClassLoader) to return the highest-priority Logging implementation from SPI (uses Prioritized and ServiceLoaderUtils.loadFirstService). Update Javadoc to clarify priority ordering for loadAll, add unit test (testLoad) asserting the prioritized implementation is returned, and set MAX_PRIORITY in TestingLogging by implementing getPriority(). Minor import adjustments.
Replace direct instantiation of LogbackLogging with a call to LoggingUtils.load() in the test setup and add the corresponding static import. This ensures the test uses the configured loader/factory instance (cast to LogbackLogging) rather than creating a new instance directly.
Replace the previous service loader call with LoggingUtils.load() in JavaLoggingTest#setUp. Removed the unused io.microsphere.logging.Logging import and the old loadFirstService static import, and added a static import for io.microsphere.logging.LoggingUtils.load. This simplifies obtaining the JavaLogging test instance.
Replace ServiceLoaderUtils.loadFirstService(Logging.class) with LoggingUtils.load in Log4j2LoggingTest#setUp to simplify loading the Logging implementation. Remove the now-unused io.microsphere.logging.Logging import and the static ServiceLoaderUtils import, and add a static import for LoggingUtils.load.
Deletes the microsphere-java-annotations dependency and removes the <optional>true</optional> flag from microsphere-java-core in microsphere-logging-commons/pom.xml. This ensures microsphere-java-core is always brought in and removes an unnecessary annotations dependency.
Introduce a new microsphere-logging-examples Maven module with its own POM. The module declares dependencies on microsphere-java-logging, microsphere-logback, microsphere-log4j2 and concrete Logback/Log4j2 artifacts, and disables deployment for example builds. Add a LoggingExample Java class that demonstrates loading the highest-priority Logging implementation and logging its name and logger names. Include a simple log4j2.xml that configures a console appender and root logger. Also update the parent pom.xml to register the new module.
Add Versions and Compatibility sections to README outlining supported Java, JUnit, SLF4J, Logback and Log4j2 for 0.2.x and 0.1.x. Update dependency examples to include microsphere-java-logging, microsphere-logback, microsphere-log4j2 and their runtime deps (logback, log4j2), replacing the old microsphere-logging-commons artifact in the sample. Include a Java usage example showing how to load the Logging instance and sample run output, and reference the microsphere-logging-examples module for more samples.
Replace placeholder TODOs with a brief introduction to the Microsphere Logging Framework and a concise feature list. Describes the framework purpose and key capabilities: runtime log level management, framework-agn API (Logback/Log4j2/Java Logging), JMX operational control, testing infrastructure, and multi-tenant logging configuration support.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request restructures the logging modules to use more consistent and descriptive naming, updates dependencies to reflect these changes, and renames core classes and files to match the new conventions. The main focus is on standardizing module names (removing the
microsphere-logging-prefix where appropriate), updating the documentation and dependencies, and renaming Java classes to follow the new naming scheme.Module and Artifact Renaming:
microsphere-logging-jdk→microsphere-java-loggingmicrosphere-logging-logback→microsphere-logbackmicrosphere-logging-log4j2→microsphere-log4j2microsphere-logging-core→microsphere-logging-commons[1] [2]Dependency and Documentation Updates:
README.md. [1] [2] [3] [4] [5]Java Class and File Renaming:
JDKLogging→JavaLogging[1] [2] [3]These changes improve the clarity, maintainability, and consistency of the logging framework's structure and naming conventions.