On Jun 19, 2007, at 10:19 , Oliver Lietz wrote:
Besides, I'm generally against logging and in favor of short-lived
instances. I wouldn't want a fanatic logger to argue that his classes
has to have a long life (i.e as a singleton when it's unnecessary)
for the sake of avoiding retrieving a logger instance at every
instanciation (while instanciation IS cheap per se, I'm not convinced
that retrieving a logger is; that mostly depends on the underlying
logging mechanism, I guess)
So if I understand you right, you share the opinion to not use a
single static
instance but create a new instance variable wherever we need a logger?
no :p
Besides the use of instance vs. static variables there is another
point, the
use of isDebugEnabled() (when only a single log call is done inside
the
following block) and String concatenating.
Of course, esp. true with the slf4j api that does lazy formatting;
the isDebugEnabled usage is historical. As far as I'm concerned you
have my blessing to trash them all away. I only do so every once in a
while when I stumble across some of them and feel a itch. I consider
these kind of changes "code layout" (yes I'm abusing terms), so as I
stated before, I'd just like to avoid these changes mixed in others :)
g
----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/docs/en/editor/stayupdated.html
----------------------------------------------------------------