You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Raman Gupta (JIRA)" <ji...@apache.org> on 2018/09/04 21:10:00 UTC

[jira] [Comment Edited] (LOG4J2-2432) Make `namedLogger` more discoverable

    [ https://issues.apache.org/jira/browse/LOG4J2-2432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16603602#comment-16603602 ] 

Raman Gupta edited comment on LOG4J2-2432 at 9/4/18 9:09 PM:
-------------------------------------------------------------

[~jvz] Please comment on change, and assign to me if you agree this is valid. I think its a no-brainer.


was (Author: rocketraman):
[~jvz] Please assign to me.

> Make `namedLogger` more discoverable
> ------------------------------------
>
>                 Key: LOG4J2-2432
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2432
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Kotlin API
>    Affects Versions: Kotlin 1.0.0
>            Reporter: Raman Gupta
>            Priority: Minor
>
> Currently, when instantiating a logger by name instead of by object (such as when not in the scope of an object e.g. a top-level function), one has to use `namedLogger(name)`. This is not very discoverable -- the user will simply get a "not found" error on `logger`, with no hints or IDE feedback on what to do or why `logger` cannot be found.
> A better approach is to rename the `namedLogger` function to simply `logger`. When it is called within an Object without a parameter, the extension function will be used. When it is called with a parameter, whether inside or out, the named logger will be created. This is discoverable as the user's IDE will prompt for the missing `name` parameter when used from a top-level function, as in this scope only the named function is valid.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)