logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <ralph.go...@dslextreme.com>
Subject Re: [v2] Log4jLogEvent toString
Date Mon, 10 Dec 2012 02:34:27 GMT

On Dec 9, 2012, at 5:39 PM, Gary Gregory wrote:

> Hi All,
> 
> WRT org.apache.logging.log4j.core.impl.Log4jLogEvent's toString
> 
> Why is it:
> 
>     @Override
>     public String toString() {
>         StringBuilder sb = new StringBuilder();
>         String n = name.length() == 0 ? "root" : name;
>         sb.append("Logger=").append(n);
>         sb.append(" Level=").append(level.name());
>         sb.append(" Message").append(message.getFormattedMessage());
>         return sb.toString();
>     }
> 
> and not:
> 
>     @Override
>     public String toString() {
>         StringBuilder sb = new StringBuilder();
>         String n = name.length() == 0 ? "root" : name;
>         sb.append("Logger=").append(n);
>         sb.append(" Level=").append(level.name());
>         sb.append(" Message=").append(message.getFormattedMessage());
>         return sb.toString();
>     }
> 
> The difference being: " Message" vs. " Message=". The test org.apache.logging.log4j.core.layout.SerializedLayoutTest
looks for the output without the '='. 
> 
> Is there are reason for that.

No

> 
> I find it hard to deal with the object in the debugging without the '='.
> 

That is an error. Go ahead and fix it.

Ralph


Mime
View raw message