feat(logging): enhance logging system with context support, JSON fixes, performance improvements, and CI setup#1
Merged
Merged
Conversation
…S thread safety - Change block type from () -> Unit to () -> T to propagate return values - Replace shared mutableListOf stack on Apple targets with NSThread threadDictionary for true per-thread isolation - JVM/Android implementations unchanged (ThreadLocal already correct) - JS/Wasm/Linux/Mingw use simple var save-restore (single-threaded targets)
- Bump the library version to 1.3.0. - Update Kotlin to 2.3.20 and AGP to 9.0.1. - Update Compose Multiplatform, Foundation, and AndroidX Activity Compose dependencies in the version catalog.
- Update library versioning to 1.3.0 in Gradle dependency examples. - Update `Log.withClassTag()` usage to require a generic type. - Redesign Log Levels table to include emojis and clarified severity descriptions. - Revise "Available Sinks" section: rename `RemoteSink` to `RemoteLogSink` and provide more detailed configuration examples. - Expand "Log Formatters" section with documentation for `Default`, `Compact`, `Pretty`, and `JSON` formatters. - Update the comparison between Simple and Structured Logging APIs to reflect shared pipeline behavior and features like `TestSink` support and `LogContextHolder`. - Refine various code samples and descriptions for clarity.
- Add unit tests for `DefaultLogger`, `LoggerFactory`, `LogPipeline`, and `LogPolicy`. - Add verification tests for `DefaultLogFormatter` and `JsonLogFormatter`. - Add tests for `LogContext`, `LogContextHolder`, and `LogLevel`. - Implement `TestSink` for capturing and verifying log events in tests. - Configure test runners for JVM, JS (Karma/Mocha), and WasmJS in `build.gradle.kts`. - Add `kotlin-test` dependency to `commonTest`.
- Return "main" instead of "unknown" if the thread name is null or empty.
- Create `All Tests - All Platforms` run configuration to execute all library tests. - Create `All Tests - Skip Browser` run configuration to execute tests while skipping JS and WasmJS browser targets. - Update `.gitignore` to allow tracking of shared run configurations in the `.idea` directory.
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.
Description
This PR introduces comprehensive improvements to the logging system, including new features, bug fixes, refactoring, and CI enhancements. It focuses on improving performance, correctness, and developer experience across multiple platforms.
Features
LoggerFactoryfor improved performanceFixes
message()before level filteringJsonLogFormatterRefactoring and Improvements
LogLevelby removing explicit priority and using natural orderingformatMapmethods fromConsoleSinkandDefaultSinkLogContextHolder.withContextto return values correctlyLoggerFactoryand improve documentationcurrentTimeMillisimplementation for WasmJScurrentThreadNameimplementation for Apple targetsTests
CI/CD and Tooling
Documentation
Chore