[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4j-dev
Subject:    Re: org.apache.logging.log4j.Logger.error(Object, Throwable)
From:       Ralph Goers <ralph.goers () dslextreme ! com>
Date:       2012-09-25 2:18:27
Message-ID: 2C79BC92-06A8-497C-AAC0-78FB9EE2A2E9 () dslextreme ! com
[Download RAW message or body]

Before I have thoughts I'd have to know what you would expect to be printed. Two \
stack traces? They aren't strictly chained. 

But isn't this a case where a suppressed exception would really be used (Java 7)?  \
Log4j 2 already supports that via ThrowableProxy's getSuppressedStackTrace method.

Ralph

On Sep 24, 2012, at 4:44 PM, Gary Gregory wrote:

> The case for changing org.apache.logging.log4j.Logger.error(Object, Throwable) to \
> error(Object, Throwable...), note the "...". 
> The idea here is to deal with:
> 
> try {
> // something
> } catch (CantDoItEx1 cantDoItEx) {
> // something else to rectify the situation, like a clean up
> try {
> // clean it up
> } catch (CleanupEx cleanupEx) {
> logger.log("could not clean up", cleanupEx, cantDoItEx); 
> }
> }
> 
> Thoughts?
> 
> -- 
> E-Mail: garydgregory@gmail.com | ggregory@apache.org 
> JUnit in Action, 2nd Ed: http://bit.ly/ECvg0
> Spring Batch in Action: http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com 
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory


[Attachment #3 (unknown)]

<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space; "><div>Before I have thoughts I'd have to know \
what you would expect to be printed. Two stack traces? They aren't strictly \
chained.&nbsp;</div><div><br></div><div>But isn't this a case where a suppressed \
exception would really be used (Java 7)? &nbsp;Log4j 2 already supports that via \
ThrowableProxy's getSuppressedStackTrace \
method.</div><div><br></div><div>Ralph</div><br><div><div>On Sep 24, 2012, at 4:44 \
PM, Gary Gregory wrote:</div><br class="Apple-interchange-newline"><blockquote \
type="cite">The case for changing org.apache.logging.log4j.Logger.error(Object, \
Throwable) to error(Object, Throwable...), note the "...".<br><br>The idea here is to \
deal with:<span style="font-family:courier new,monospace"><br> <br>try \
{<br>&nbsp;&nbsp; // something<br>} catch (CantDoItEx1 cantDoItEx) {<br>&nbsp;&nbsp; \
// something else to rectify the situation, like a clean up<br>&nbsp;&nbsp; try \
{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // clean it up<br>&nbsp;&nbsp; } catch (CleanupEx \
cleanupEx) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; logger.log("could not clean up", \
cleanupEx, </span><span style="font-family:courier new,monospace"><span \
style="font-family:courier new,monospace">cantDoItEx</span>); <br> &nbsp;&nbsp; \
}<br>}</span><br><br>Thoughts?<br clear="all"><br>-- <br>E-Mail: <a \
href="mailto:garydgregory@gmail.com" target="_blank">garydgregory@gmail.com</a> | <a \
href="mailto:ggregory@apache.org" target="_blank">ggregory@apache.org </a><br> JUnit \
in Action, 2nd Ed: <a href="http://goog_1249600977/" target="_blank"></a><a \
href="http://bit.ly/ECvg0" target="_blank">http://bit.ly/ECvg0</a><br>Spring Batch in \
Action: <a href="http://s.apache.org/HOq" target="_blank"></a><a \
href="http://bit.ly/bqpbCK" rel="nofollow" \
                target="_blank">http://bit.ly/bqpbCK</a><br>
Blog: <a href="http://garygregory.wordpress.com/" \
target="_blank">http://garygregory.wordpress.com</a> <br>Home: <a \
href="http://garygregory.com/" target="_blank">http://garygregory.com/</a><br>Tweet! \
<a href="http://twitter.com/GaryGregory" \
target="_blank">http://twitter.com/GaryGregory</a><br>

</blockquote></div><br></body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic