Anders,
> > 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?
I hate to say this after the last logging discussion, but that's something
that probably should be open to discussion.
I can say that for Celtix, our policy is that the WARNING and SEVERE should
always be localized. Those are the types of things that an administrator
probably needs to know immediately to be able to diagnose and fix a problem.
("Could not connect to port 1234", "Could not resolve host name", etc...,
although a lot of those things should propogate up via localized exceptions)
The FINE and lower stuff is really just targetted at us. You need to be
really familliar with the code to get much use out of that. Thus, not
locallizing those is probably preferred. The INFO is in the "grey" area.
If it's something and administrator may need to know, go ahead, but I'm not
so sure about requiring it.
--
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727 C: 508-380-7194 F:781-902-8001
[EMAIL PROTECTED]