logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject [v2] Log4jLogEvent toString
Date Mon, 10 Dec 2012 01:39:48 GMT
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.

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

Thank you,
Gary


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
View raw message