[slf4j-dev] [JIRA] (SLF4J-124) Add ability to log at a dynamic level

QOS.CH (JIRA) noreply-jira at qos.ch
Thu Jan 19 23:51:01 CET 2017


    [ https://jira.qos.ch/browse/SLF4J-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18058#comment-18058 ] 

Joern Huxhorn commented on SLF4J-124:
-------------------------------------

The problem is that you would still need to implement all of these methods for each and every enum value:
{code}
boolean isEnabled(Logger logger);
void log(Logger logger, String msg);
void log(Logger logger, String format, Object arg);
void log(Logger logger, String format, Object arg1, Object arg2);
void log(Logger logger, String format, Object... arguments);
void log(Logger logger, String msg, Throwable t);
boolean isEnabled(Logger logger, Marker marker);
void log(Logger logger, Marker marker, String msg);
void log(Logger logger, Marker marker, String format, Object arg);
void log(Logger logger, Marker marker, String format, Object arg1, Object arg2);
void log(Logger logger, Marker marker, String format, Object... argArray);
void log(Logger logger, Marker marker, String msg, Throwable t);
{code}

I don't think that this would be a good idea. But that's just me. I'm not the owner of the project.

> Add ability to log at a dynamic level
> -------------------------------------
>
>                 Key: SLF4J-124
>                 URL: https://jira.qos.ch/browse/SLF4J-124
>             Project: SLF4J
>          Issue Type: Improvement
>          Components: Core API
>    Affects Versions: 1.5.x
>         Environment: Operating System: All
> Platform: All
> URL: http://stackoverflow.com/questions/2621701/setting-log-level-of-message-at-runtime-in-slf4j
>            Reporter: Robert Elliot
>            Assignee: SLF4J developers list
>         Attachments: Util.java.patch
>
>
> It is occasionally useful to have a log method that takes a level as a parameter.  The necessary methods can be added to the Util class without any compatibility issues as far as I can see - see attached patch.



--
This message was sent by Atlassian JIRA
(v6.4.12#64027)


More information about the slf4j-dev mailing list