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

Nick Williams commented on LOG4J2-41:
-------------------------------------

But isn't your proposal less safe and more complex? Is it really accurate to 
say that we know best what every single user will need, and therefore we should 
make it difficult for them to do other than what we want them to do?

I've actually changed my mind since I said, "I'm fine leaving it the way it is, 
but this could achieve the functional equivalent and appease those who wish to 
see this extensible." I think this is a significant improvement and has zero 
risk. This is actually the way java.util.logging.Level is implemented.

Can you name any downsides to creating an extensible enum? I'm trying to think 
of some, and I can't. I can, however, name some downsides to your proposal:

- Adds yet another set of 14 more methods to the Logger interface
- Adds the complexity of a developer having to define a custom strategy
- Makes it difficult (impossible?) to use custom log levels from a the tag 
library I'm working on

The extensible enum proposal has none of these downsides.
                
> Extensible Log Level
> --------------------
>
>                 Key: LOG4J2-41
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-41
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: API
>            Reporter: Ralph Goers
>
> It is desirable to have the Level be an enum. However, it is also desirable 
> to let users add new log levels. These goals are in opposition to each other 
> since enum classes are final. In addition, adding new levels implies adding 
> new methods to the Logger interface (or some counterpart to it). This would 
> be unworkable.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to