Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #131 +/- ##
============================================
- Coverage 15.24% 14.59% -0.65%
Complexity 147 147
============================================
Files 96 103 +7
Lines 2617 2733 +116
Branches 365 380 +15
============================================
Hits 399 399
- Misses 2188 2304 +116
Partials 30 30 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR bumps the version from 2.0.0-SNAPSHOT.380 to 2.0.0-SNAPSHOT.390 and introduces significant architectural improvements to the logging library's multi-platform design. The changes move from platform-specific expect/actual declarations to common implementations with platform-specific details where needed, improving code reuse and maintainability.
Key changes include:
- Consolidation of logging scope and recursion depth management into common code using coroutine contexts
- Refactoring of weak reference handling and stack trace utilities to use shared implementations
- Simplification of the logging API by removing platform-specific abstractions
Reviewed Changes
Copilot reviewed 24 out of 31 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| version.gradle.kts, pom.xml | Version bump to 2.0.0-SNAPSHOT.390 |
| logging/src/commonMain/kotlin/io/spine/logging/util/RecursionDepth.kt | Moved from expect/actual to common implementation using CoroutineContext |
| logging/src/commonMain/kotlin/io/spine/logging/WithLogging.kt | Changed from expect interface to common interface with default implementation |
| logging/src/commonMain/kotlin/io/spine/logging/WeakRef.kt | Refactored from WithLogging to WeakRef with platform-agnostic API |
| logging/src/commonMain/kotlin/io/spine/logging/LoggingScope.kt | Moved from expect/actual to common abstract class with concrete implementation |
| logging/src/commonMain/kotlin/io/spine/logging/KeyPart.kt | Converted from expect/actual to common implementation |
| logging/src/jvmMain/kotlin/io/spine/logging/WeakRef.kt | JVM-specific implementation using Java WeakReference |
| logging/src/jvmMain/kotlin/io/spine/logging/LoggingFactory.kt | Variable renaming for clarity |
logging/src/commonMain/kotlin/io/spine/logging/StackTraceElement.kt
Outdated
Show resolved
Hide resolved
…epth.kt Fix guarding overflow Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The change was incorrect because the code guards against going the depth below zero. When the recursion depth becomes zero the context should be freed: see `close()` on this. When we encounter a depth instance which is `-1` it's the error we should report.
logging/src/commonMain/kotlin/io/spine/logging/util/RecursionDepth.kt
Outdated
Show resolved
Hide resolved
logging/src/commonMain/kotlin/io/spine/logging/LogPerBucketingStrategy.kt
Outdated
Show resolved
Hide resolved
logging/src/commonMain/kotlin/io/spine/logging/LogPerBucketingStrategy.kt
Outdated
Show resolved
Hide resolved
logging/src/commonMain/kotlin/io/spine/logging/LogPerBucketingStrategy.kt
Outdated
Show resolved
Hide resolved
logging/src/commonMain/kotlin/io/spine/logging/LogSiteLookup.kt
Outdated
Show resolved
Hide resolved
logging/src/commonMain/kotlin/io/spine/logging/LogSiteLookup.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 25 out of 32 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
logging/src/commonMain/kotlin/io/spine/logging/WeakRef.kt:1
- There's a typo in the documentation comment. 'WeekRef' should be 'WeakRef'.
/*
logging/src/commonMain/kotlin/io/spine/logging/AbstractLogger.kt
Outdated
Show resolved
Hide resolved
logging/src/commonMain/kotlin/io/spine/logging/LogPerBucketingStrategy.kt
Show resolved
Hide resolved
logging/src/commonMain/kotlin/io/spine/logging/backend/SimpleMessageFormatter.kt
Show resolved
Hide resolved
logging/src/commonMain/kotlin/io/spine/logging/LogPerBucketingStrategy.kt
Show resolved
Hide resolved
Also: * Remove extra empty line.
This PR continues making the
loggingmodule more platform-neutral. The details are covered by the sections below.Classes moved under
commonMainCountingRateLimiterDurationRateLimiterLogContextLogSiteGroupingKeyRateLimitingPeriodRateLimitStatusSamplingRateLimiterOther notable changes
ReqursionDepthclass was reworked narrowing down theexpect/actualto the newly introducedWeekRefclass. So, now theReqursionDepthclass class uses theCouroutineContextkey Kotlin's feature, which is platform neutral.LoggingScope,LogPerBucketingStrategy, classes, andLogSiteLookupobject were reworked to avoid unnecessaryexpect/actualarrngament.expect/actualfun stackForCallerOf()to make the created stack trace platform-neutral.expect/actualarrangement for theWithLogginginterface as no longer necessary.expect/actualarrrangement for theLoggingScopeclass as no longer necessary.expect/actualarrrangement for theLogPerBucketingStrategyclass as no longer necessary.