David Graham wrote:
Sorry, I don't follow what you're saying. Are you talking about the log variable being protected, using the wrong class in getLog(), using the wrong message key?
Close.

When I derive a class
class NewMessageTag extends Messagetag {

setMessage(String message) {
super(message);
log.debug('-message set-');
}

}

The logging output would look like:
Feb 14 2003 DEBUG org.apache.struts.taglib.html.MessageTag -message set-

This makes it look like the message is from MessageTag,
when actually NewMessageTag sent it.

In most cases you would probably want:
Feb 14 2003 DEBUG net.sf.free2create.taglib.NewMessageTag -message set-

It's true that nothing stops NewMessageTag from declaring its
own Log instance.

Example:
A guy here at my job swore he couldn't isolate the debugging,
to a class. It was pretty easy to track down he was using
a logging statement was cut and pasted from another class, which
had the classname hard coded in the LogFactory() statement.

It is a matter of taste and balancing the number of objects created vs avoiding inaccurate logs.

-Rob


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to