incubator-yoko-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anders Hessellund Jensen <>
Subject Re: Logging guidelines
Date Thu, 22 Jun 2006 13:15:33 GMT
Comments inline.

> I think it would be better if it was:
> FINE corresponds to nothing
> FINER corresponds to FINER
> FINEST corresponds to TRACE
> That leaves "FINE" open as a spot between info and debug.    One area I think 
> we use that spot in celtix is for logging buffers.   Buffers are something 
> that falls between info stuff (service deployed, client connect, etc...) and 
> debug.   Many times, people want the buffers, but without all the extra debug 
> stuff that really doesn't apply to them.
> That said, buffers are more useful in SOAP/XML than IIOP.   :-)

Sounds fine.

> Neither of those avoid the string concatination.   The whole point of the "if" 
> statement is to make sure the string concat isn't done as that is potentially 
> very costly.   It's a little more verbose, but it's really the only way to 
> avoid it.

Thats right, i don't know what I was thinking.

> That said, the "more correct" way to do it would be with a resource bundle:
> log.log(Level.FINER, "ABOUT_TO_DO_STUFF_ID", stuff);
> or, since it's FINER and we don't really care anout localizationn:
> log.log(Level.FINER, "About to do stuff {0}", stuff);
> That only works for a single param though.    For multiple params, it would 
> be:
> log.log(Level.FINER, "About to do stuff {0} and {1}",
>                                    new Object[] {stuff, stuff1});
> in which case you would want to wrap it with the if statement to avoid 
> the "new Object[]" creation.   (although the Object[] creation is a lot 
> cheaper than the string concat)

So, INFO and higher messages should be localized?


View raw message