Open ttypic opened 1 week ago
The changes in this pull request involve modifications to several files in the Android project. Key updates include enabling core library desugaring in the build.gradle.kts
files, enhancing logging capabilities in the ChatApi
and DefaultChatClient
classes, and the introduction of a new Logger
framework. Additionally, test files have been updated to incorporate the new logging functionality. The overall structure of the project remains intact, with specific enhancements aimed at improving error handling and logging without altering existing functionalities.
File Path | Change Summary |
---|---|
chat-android/build.gradle.kts |
Added isCoreLibraryDesugaringEnabled and coreLibraryDesugaring(libs.desugar.jdk.libs) in dependencies. |
chat-android/src/main/java/com/ably/chat/ChatApi.kt |
Updated constructor to include logger: Logger and added logging in error handling methods. |
chat-android/src/main/java/com/ably/chat/ChatClient.kt |
Added private val logger: Logger and modified ChatApi instantiation to include logger . |
chat-android/src/main/java/com/ably/chat/ClientOptions.kt |
Removed import statement for Log.LogHandler ; no changes to class structure. |
chat-android/src/main/java/com/ably/chat/Logger.kt |
Introduced a new logging framework with LogHandler , LogContext , and Logger interface implementations. |
chat-android/src/test/java/com/ably/chat/ChatApiTest.kt |
Updated ChatApi instantiation to include logger = EmptyLogger . |
chat-android/src/test/java/com/ably/chat/MessagesTest.kt |
Updated ChatApi instantiation to include logger: Logger . |
example/build.gradle.kts |
Added isCoreLibraryDesugaringEnabled and coreLibraryDesugaring(libs.desugar.jdk.libs) in dependencies. |
gradle/libs.versions.toml |
Added version reference and library entry for desugar-jdk-libs . |
chat-android/src/main/java/com/ably/chat/Utils.kt |
Added new function generateUUID() for generating random UUIDs. |
build.gradle.kts
file regarding the isCoreLibraryDesugaringEnabled
property and the addition of the coreLibraryDesugaring
dependency are relevant as they enhance the build configuration, which is foundational for the overall project structure, including the chat functionalities.Messages
interface and its implementation in the DefaultMessages
class, particularly the introduction of the MessagesSubscription
interface, are directly related to the messaging functionalities being enhanced in the main PR.ChatApi
class, including the addition of the fromSerial
parameter in the getMessages
method, are relevant as they enhance the message retrieval capabilities, aligning with the objectives of the main PR.ChatApi
class for sending and receiving messages, including validation logic and error handling improvements, are directly related to the messaging functionalities being developed in the main PR.🐰 In the code we hop and play,
New logs to track our way.
With desugaring, we can see,
Java features, oh so free!
Errors logged with care and grace,
In our chat, we find our place.
Hooray for changes, hip-hip-hooray! 🥕
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Hey, you might like to take a look at https://github.com/ably-labs/ably-chat-kotlin/issues/20#issuecomment-2419626548. I will review the PR tomorrow
@ttypic you can also have a read -> https://betterstack.com/community/guides/logging/logging-microservices/ Also, some articles on the internet related to logger architecture are available, good for reference.
Added logger abstraction
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Documentation
Chores