You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Remko Popma <re...@gmail.com> on 2014/03/25 00:47:21 UTC
Level.isGreaterOrEqual: svn commit: r1581082 - /logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
I may have lost track with the many commits recently, but is Level.isGreaterOrEqual a newly added method? If it was a previously existing method in log4j2 then is it really a good idea to reverse the meaning?
Sent from my iPhone
Sent from my iPhone
> On 2014/03/25, at 6:49, ggregory@apache.org wrote:
>
> Author: ggregory
> Date: Mon Mar 24 21:49:15 2014
> New Revision: 1581082
>
> URL: http://svn.apache.org/r1581082
> Log:
> Fix level comparisons, version 1 and 2 are opposites in usage of internal level ints!
>
> Modified:
> logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
>
> Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
> URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java?rev=1581082&r1=1581081&r2=1581082&view=diff
> ==============================================================================
> --- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java (original)
> +++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java Mon Mar 24 21:49:15 2014
> @@ -153,7 +153,7 @@ public final class Level implements Comp
> * @return True if the given Level is less specific or the same than this Level.
> */
> public boolean isGreaterOrEqual(final int level) {
> - return this.intLevel >= level;
> + return this.intLevel <= level;
> }
>
> /**
> @@ -163,7 +163,7 @@ public final class Level implements Comp
> * @return True if the given Level is less specific or the same than this Level.
> */
> public boolean isGreaterOrEqual(final Level level) {
> - return this.intLevel >= level.intLevel;
> + return this.intLevel <= level.intLevel;
> }
>
> /**
>
>
Re: Level.isGreaterOrEqual: svn commit: r1581082 - /logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
Posted by Remko Popma <re...@gmail.com>.
Thanks for the clarification.
Just took a quick look. Level now has methods isGreaterOrEqual and isLessOrEqual, and they are both implemented as
return this.intLevel <= level.intLevel;
That looks strange.
Sent from my iPhone
> On 2014/03/25, at 9:00, Ralph Goers <ra...@dslextreme.com> wrote:
>
> Gary just added it. As I stated earlier, I am not really in favor of it and would prefer that it and isLessOrEqual both be removed leaving only isAtLeastAsSpecificAs, which is the Log4j 2 equivalent of isGreaterOrEqual in Log4j 1.
>
>
>> On Mar 24, 2014, at 4:47 PM, Remko Popma <re...@gmail.com> wrote:
>>
>> I may have lost track with the many commits recently, but is Level.isGreaterOrEqual a newly added method? If it was a previously existing method in log4j2 then is it really a good idea to reverse the meaning?
>>
>> Sent from my iPhone
>>
>> Sent from my iPhone
>>
>>> On 2014/03/25, at 6:49, ggregory@apache.org wrote:
>>>
>>> Author: ggregory
>>> Date: Mon Mar 24 21:49:15 2014
>>> New Revision: 1581082
>>>
>>> URL: http://svn.apache.org/r1581082
>>> Log:
>>> Fix level comparisons, version 1 and 2 are opposites in usage of internal level ints!
>>>
>>> Modified:
>>> logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
>>>
>>> Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
>>> URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java?rev=1581082&r1=1581081&r2=1581082&view=diff
>>> ==============================================================================
>>> --- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java (original)
>>> +++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java Mon Mar 24 21:49:15 2014
>>> @@ -153,7 +153,7 @@ public final class Level implements Comp
>>> * @return True if the given Level is less specific or the same than this Level.
>>> */
>>> public boolean isGreaterOrEqual(final int level) {
>>> - return this.intLevel >= level;
>>> + return this.intLevel <= level;
>>> }
>>>
>>> /**
>>> @@ -163,7 +163,7 @@ public final class Level implements Comp
>>> * @return True if the given Level is less specific or the same than this Level.
>>> */
>>> public boolean isGreaterOrEqual(final Level level) {
>>> - return this.intLevel >= level.intLevel;
>>> + return this.intLevel <= level.intLevel;
>>> }
>>>
>>> /**
>
Re: Level.isGreaterOrEqual: svn commit: r1581082 - /logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
Posted by Ralph Goers <ra...@dslextreme.com>.
Gary just added it. As I stated earlier, I am not really in favor of it and would prefer that it and isLessOrEqual both be removed leaving only isAtLeastAsSpecificAs, which is the Log4j 2 equivalent of isGreaterOrEqual in Log4j 1.
On Mar 24, 2014, at 4:47 PM, Remko Popma <re...@gmail.com> wrote:
> I may have lost track with the many commits recently, but is Level.isGreaterOrEqual a newly added method? If it was a previously existing method in log4j2 then is it really a good idea to reverse the meaning?
>
> Sent from my iPhone
>
> Sent from my iPhone
>
> On 2014/03/25, at 6:49, ggregory@apache.org wrote:
>
>> Author: ggregory
>> Date: Mon Mar 24 21:49:15 2014
>> New Revision: 1581082
>>
>> URL: http://svn.apache.org/r1581082
>> Log:
>> Fix level comparisons, version 1 and 2 are opposites in usage of internal level ints!
>>
>> Modified:
>> logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
>>
>> Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
>> URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java?rev=1581082&r1=1581081&r2=1581082&view=diff
>> ==============================================================================
>> --- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java (original)
>> +++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java Mon Mar 24 21:49:15 2014
>> @@ -153,7 +153,7 @@ public final class Level implements Comp
>> * @return True if the given Level is less specific or the same than this Level.
>> */
>> public boolean isGreaterOrEqual(final int level) {
>> - return this.intLevel >= level;
>> + return this.intLevel <= level;
>> }
>>
>> /**
>> @@ -163,7 +163,7 @@ public final class Level implements Comp
>> * @return True if the given Level is less specific or the same than this Level.
>> */
>> public boolean isGreaterOrEqual(final Level level) {
>> - return this.intLevel >= level.intLevel;
>> + return this.intLevel <= level.intLevel;
>> }
>>
>> /**
>>
>>