logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38125] - add Throwable to message pattern log methods
Date Wed, 04 Jan 2006 19:48:49 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38125>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38125





------- Additional Comments From michael.newcomb@gdc4s.com  2006-01-04 20:48 -------
How about:

public void debug(String messagePattern, Object[] args) {
  if (repository.isDisabled(Level.DEBUG_INT)) {
    return;
  }
  if (Level.DEBUG.isGreaterOrEqual(this.getEffectiveLevel())) {

    // add format(String, Object[] args) to MessageFormatter
    //
    messagePattern = MessageFormatter.format(messagePattern, args);

    // get last item in argument list
    //
    Object o = args != null && args.length > 0 ? args[args.length - 1] : null;

    forcedLog(FQCN, Level.DEBUG, messagePattern,
              o instanceof Throwable ? (Throwable) o : null);
  }
}

And for JDK 1.5:
public void debug(String messagePattern, Object... args) {
  ...
}


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message