Skip to content

trace/debug/info/warn/error with marker deprecated though alternative is ambigious #488

@jensbaitingerbosch

Description

@jensbaitingerbosch

I will explain this bug with info(...), the same issue with debug, warn etc.

KLogger.info(Marker, ()-> Any?) is marked as deprecated withe the replacement info(null, marker, msg)

The issue is, that using this replacement is ambiguous causing the following compiler error:

Overload resolution ambiguity between candidates:
fun info(marker: Marker?, t: Throwable?, msg: () -> Any?): Unit
fun info(marker: Marker?, msg: String?, arg: Any?): Unit

Only calling the function like this log.info(marker, throwable=null, msg) satisfies the compiler. Which makes the call more complex (even with log.info(marker, null, msg) the null looks unnecessary.

Suggestion: undeprecate the function KLogger.info(Marker, ()-> Any?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions