realm / realm-kotlin

Kotlin Multiplatform and Android SDK for the Realm Mobile Database: Build Better Apps Faster.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement new log category for RealmLogger

sync-by-unito opened this issue · comments

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?
    )
}

➤ PM Bot commented:

Jira ticket: RKOTLIN-1038