Travis Camechis wrote:
> That is interesting. Seems like a silly thing to do just for a debug
> statement.
>From what i read on google, there's no real benefit if you're just doing:
log.debug("this is a message")
But when you start doing string concatenation and getting the values of
things in the debug statement, it starts to get unacceptably expensive.
Of course it makes sense to wrap:
log.debug("Message: " + getExpensiveOperationResult())
But I wouldn't have thought simple string concatenation would be *that*
expensive. Apparently it is (probably when doing it multiple times
repeatedly) such that it warrants being wrapped.
>
> On Wed, Mar 18, 2009 at 12:05 PM, Devan Goodwin <[email protected]
> <mailto:[email protected]>> wrote:
>
> On Wed, 18 Mar 2009 11:57:00 -0400
> Justin Sherrill <[email protected] <mailto:[email protected]>>
> wrote:
>
>
>> Might be a nice thing to do after the next fork for Sat. Having to
>> use log.isDebugEnabled() is ugly IMO and it'd be nice not to have to
>> do it where we don't have to.
>
> I hate doing this too. I was gonna take issue with it as it's ugly and
> seemed pretty silly until I googled and saw that it is best practice if
> the statement is doing string contact.
>
> Cheers,
>
> Devan
>
_______________________________________________
Spacewalk-devel mailing list
[email protected] <mailto:[email protected]>
https://www.redhat.com/mailman/listinfo/spacewalk-devel
> ------------------------------------------------------------------------
> _______________________________________________
> Spacewalk-devel mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/spacewalk-devel
--
Justin Sherrill, RHCA 1801 Varisty Drive.
Software Engineer Raleigh, NC 27603
Red Hat, Inc.
_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel