Issue Type: Bug Bug
Assignee: Logback dev list
Components: logback-classic
Created: 29/Oct/12 4:22 PM
Description: The Level.toLocationAwareLoggerInteger() method was added in 1.0.1 for http://jira.qos.ch/browse/LOGBACK-219
This method is not static but it has a Level parameter which is unnecessary. Currently the method signature is the following:
public int toLocationAwareLoggerInteger(Level level);

This means that if you have a Level instance in your code and you want to convert it to an int, you can only do it redundantly:
Level level = ...;
int levelInt = level.toLocationAwareLoggerInteger(level);

Instead, it could be a static helper method (similar to fromLocationAwareLoggerInteger()) with the following signature:
public static int toLocationAwareLoggerInteger(Level level);
So that you can call:
Level level = ...;
int levelInt = Level.toLocationAwareLoggerInteger(level);

Or, preferably, the Level parameter could be omitted as you already have a level instance:
public int toLocationAwareLoggerInteger();
(Then in the method body, "this" could be used instead of the parameter, and the null check becomes unnecessary.)

So that you can call:
Level level = ...;
int levelInt = level.toLocationAwareLoggerInteger();
Project: logback
Priority: Trivial Trivial
Reporter: Patrik Varga
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