Skip to content
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

Implement new log category for RealmLogger #1691

Closed
sync-by-unito bot opened this issue Mar 15, 2024 · 1 comment · Fixed by #1692
Closed

Implement new log category for RealmLogger #1691

sync-by-unito bot opened this issue Mar 15, 2024 · 1 comment · Fixed by #1692
Assignees

Comments

@sync-by-unito
Copy link

sync-by-unito bot commented Mar 15, 2024

The new improved logging for Realm allows fine-grain log level definition per category. These categories are defined in a tree-like hierarchy, and behave cascading style, setting the level to a top category would change all its leaves.

RealmLog would see the current level property deprecated in favor of a setter and getter functions.

RealmLog {
    @Deprecated
    public var level: LogLevel

    public fun setLevel(level: LogLevel, category: LogCategory)
    public fun getLevel(category: LogCategory): LogLevel
}

The custom logger interface also gets modified adding a new method that has the category in its signature. Backward compatibility would be ensured to the current deprecated methods.

RealmLogger {
    public fun log(
        category: LogCategory, 
        level: LogLevel, 
        throwable: Throwable?, 
        message: String?, 
        vararg args: Any?
    )
}
Copy link
Author

sync-by-unito bot commented Mar 15, 2024

➤ PM Bot commented:

Jira ticket: RKOTLIN-1038

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant