-
Notifications
You must be signed in to change notification settings - Fork 0
Simplify Logger API, add shortcut properties for WithLogging
#132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #132 +/- ##
============================================
+ Coverage 14.59% 14.82% +0.22%
Complexity 147 147
============================================
Files 103 102 -1
Lines 2733 2691 -42
Branches 380 374 -6
============================================
Hits 399 399
+ Misses 2304 2262 -42
Partials 30 30 🚀 New features to boost your workflow:
|
Also: * Add more `AbstractLogger.atXxx()` functions for missing `Level` values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR simplifies the Logger API by eliminating intermediate classes and streamlining the logging factory implementation. The main changes consolidate logging functionality into a single Logger class instead of the previous multi-layered approach with JvmLogger and Middleman.
- Removed
JvmLoggerandMiddlemanclasses in favor of a unifiedLoggerimplementation - Moved the consolidated
Loggerclass tocommonMainfor broader platform support - Refactored
LoggingFactoryto use a nested object pattern forClassValue<Logger>handling
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| version.gradle.kts | Version bump to 2.0.0-SNAPSHOT.400 |
| pom.xml | Version update in Maven POM |
| dependencies.md | Updated dependency report with new version |
| logging/src/commonMain/kotlin/io/spine/logging/Logger.kt | New unified Logger implementation moved from JVM-specific code |
| logging/src/commonMain/kotlin/io/spine/logging/LoggingFactory.kt | Updated factory to return non-generic Logger instances |
| logging/src/commonMain/kotlin/io/spine/logging/WithLogging.kt | Updated interface to use non-generic Logger type |
| logging/src/jvmMain/kotlin/io/spine/logging/LoggingFactory.kt | Refactored with nested LoggerClassValue object |
| logging/src/jvmMain/kotlin/io/spine/logging/LevelExts.kt | New file containing Level extension functions |
| Multiple test files | Updated type references from JvmLogger to Logger |
| Backend files | Updated import statements to use new Levels class |
backends/jul-backend/src/main/java/io/spine/logging/backend/jul/AbstractJulBackend.java
Outdated
Show resolved
Hide resolved
backends/jul-backend/src/main/java/io/spine/logging/backend/jul/AbstractJulBackend.java
Show resolved
Hide resolved
backends/jul-backend/src/main/java/io/spine/logging/backend/jul/AbstractJulBackend.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.
Logger APILogger API, add shortcut properties for WithLogging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
This PR simplifies the
LoggerAPI avoiding the intermediateJvmLoggerandMiddlemanclasses that were needed when the real logger had to be façaded under the abstract API which usesio.spine.logging.LevelandLoggingDomain.Implementation details
The
Middlemanclass was renamed toLoggerand pushed to thecommonMain. TheJvmLoggerwas eliminated.The
Middleman.forEnclosedClass()was removed in favor of already presentLoggingFactory.forEnclosedClass()factory function.Shortcut properties for
at<Level>methods of aLoggerThe
WithLogginginterface gotatSevere,atInfo,atDebugand the like properties that serve as a shortcut forlogger.atSevere()and the like methods. This is for brevity of the logging calls:atInfo.log { "Warming up..." }Other notable changes
Levelclasses were moved underLoggerExts.ktfile.LoggingFactorywas reworked to handleClassValue<Logger>via a nested object instead of using inheritance.Breaking API change
The
Loggerclass now does not have a generic parameter. SoLogger<*>orLogger<?>at the usage sites must be replaced with justLogger.