Wyss Patrick wrote:
Why does the logger force you to use Strings?
no body is forced to log *strings* have a look at the signature of
Logger.info():
public void info(Object message)
Internally, I'm sure the info() method is calling Object.toString(),
which does create a new String object.
so use StringBuffers (or if using java1.5 StringBuilder) if you like to.
however IMHO your code is generating unnecessary String objects as well.
// to log a new message
buf.clear();
buf.append("some string here");
this creates a String object on every call as well...
it's the same as:
buf.append(new String("some string here"));
No, I don't think so. "some string here" is a constant. It gets
interned. No new object gets created on each call. The String gets
created once when the class loads.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]