You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "dam6923 ." <da...@gmail.com> on 2017/10/12 20:17:10 UTC

stringifyException

Hello,

Can someone please explain what the value of
org.apache.hadoop.util.StringUtils#stringifyException is?  How is this
better than just allowing the logging framework to format the
exception information?

LOG.warn("show function: {}", stringifyException(e));

v.s.

LOG.warn("show function: ", e);

Thanks!

---------------------------------------------------------------------
To unsubscribe, e-mail: common-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-dev-help@hadoop.apache.org


Re: stringifyException

Posted by "dam6923 ." <da...@gmail.com>.
I'm trying to pitch in a little and update components to use slf4j
parameterization, would it be helpful to remove this and simply use
the sl4j error printing facilities instead?

Thanks!

On Thu, Oct 12, 2017 at 4:20 PM, Owen O'Malley <ow...@gmail.com> wrote:
> It is a very old relic from when logging the exception just gave you the
> message. It can should be replaced at some point.
>
> .. Owen
>
> On Thu, Oct 12, 2017 at 1:17 PM, dam6923 . <da...@gmail.com> wrote:
>>
>> Hello,
>>
>> Can someone please explain what the value of
>> org.apache.hadoop.util.StringUtils#stringifyException is?  How is this
>> better than just allowing the logging framework to format the
>> exception information?
>>
>> LOG.warn("show function: {}", stringifyException(e));
>>
>> v.s.
>>
>> LOG.warn("show function: ", e);
>>
>> Thanks!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: common-dev-unsubscribe@hadoop.apache.org
>> For additional commands, e-mail: common-dev-help@hadoop.apache.org
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: common-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-dev-help@hadoop.apache.org


Re: stringifyException

Posted by Steve Loughran <st...@hortonworks.com>.
> On 12 Oct 2017, at 21:20, Owen O'Malley <ow...@gmail.com> wrote:
> 
> It is a very old relic from when logging the exception just gave you the
> message. It can should be replaced at some point.
> 

I was staring at the code in org.apache.hadoop.mapred.Task about ten minutes ago thinking exactly that. 

Though I was also thinking "I wonder when the whole or MRv1 could be removed" and "won't 'doAs() be simpler if all moved to Java-8 lambda expressions"

Doing things about logging is probably the easiest. mapred.Task and friends are still on org.apache.commons.logging.Log too, so maybe they could be cleaned up *very, very carefully, one file at a time*


---------------------------------------------------------------------
To unsubscribe, e-mail: common-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-dev-help@hadoop.apache.org


Re: stringifyException

Posted by Owen O'Malley <ow...@gmail.com>.
It is a very old relic from when logging the exception just gave you the
message. It can should be replaced at some point.

.. Owen

On Thu, Oct 12, 2017 at 1:17 PM, dam6923 . <da...@gmail.com> wrote:

> Hello,
>
> Can someone please explain what the value of
> org.apache.hadoop.util.StringUtils#stringifyException is?  How is this
> better than just allowing the logging framework to format the
> exception information?
>
> LOG.warn("show function: {}", stringifyException(e));
>
> v.s.
>
> LOG.warn("show function: ", e);
>
> Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: common-dev-unsubscribe@hadoop.apache.org
> For additional commands, e-mail: common-dev-help@hadoop.apache.org
>
>