commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [logging] logging vs slf4j
Date Fri, 05 Aug 2011 16:06:26 GMT
On Fri, Aug 5, 2011 at 8:59 AM, Gary Gregory <garydgregory@gmail.com> wrote:
> On Fri, Aug 5, 2011 at 8:23 AM, Bill Speirs <bill.speirs@gmail.com> wrote:
>> IMO, saying "Don't do logging in a library" seems like a bad rule.
>>
>> The HTTPComponents client has logging and it has been VERY helpful to be
>> able to turn on debug logging and see what requests and responses are going
>> over the wire. Yes, I could fire up Wireshark and get the same info, but
>> turning on logging is so much easier... I only wish they had this for the
>> HttpCore stuff.
>>
>> Why do you suggest no logging for libraries?
>
> Yes, IMO the question should be: How and when do you do logging in a library?
>
> - if () System.out...
> - // System.out...
> - A logging lib
> - ...

For example, in [codec] trunk, the new BM encoder uses "// System.out"
(yuck), which then causes PMD warnings because some blocks are empty.

Gary

>
> Gary
>
>>
>> Bill-
>>
>> On Aug 5, 2011 2:19 AM, "Henri Yandell" <flamefew@gmail.com> wrote:
>>> On Wed, Aug 3, 2011 at 7:51 AM, Gary Gregory <garydgregory@gmail.com>
>> wrote:
>>>> On Wed, Aug 3, 2011 at 10:33 AM, Paul Benedict <pbenedict@apache.org>
>> wrote:
>>>>> I prefer Apache driven projects when possible. If LOG4J2 takes off,
>>>>> feature requests would be implemented quicker, I hope.
>>>>
>>>> I like Log4J just fine thank you very much :)
>>>>
>>>> I'm looking forward to 2.0.
>>>
>>> That's generally where I am thought-wise.
>>>
>>> A) If you're a generic reusble library; don't do logging if you can help
>> it.
>>> B) If you are an app, use log4j.
>>> C) If you truly need a bridge, use SLF4j.
>>>
>>> Hen
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>
>
>
>
> --
> Thank you,
> Gary
>
> http://garygregory.wordpress.com/
> http://garygregory.com/
> http://people.apache.org/~ggregory/
> http://twitter.com/GaryGregory
>



-- 
Thank you,
Gary

http://garygregory.wordpress.com/
http://garygregory.com/
http://people.apache.org/~ggregory/
http://twitter.com/GaryGregory

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


Mime
View raw message