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();
|