You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Fábio Lima Santos (JIRA)" <ji...@apache.org> on 2008/04/04 14:05:27 UTC
[jira] Updated: (LOGGING-121) Extend the
org.apache.commons.logging.Log interface for suitable use
[ https://issues.apache.org/jira/browse/LOGGING-121?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fábio Lima Santos updated LOGGING-121:
--------------------------------------
Description:
For getting better source code legibility, I propose the extension of the org.apache.commons.logging.Log interface adding the methods above:
void trace(String message, Object... params);
void trace(String message, Throwable t, Object... params);
void debug(String message, Object... params);
void debug(String message, Throwable t, Object... params);
void info(String message, Object... params);
void info(String message, Throwable t, Object... params);
void warn(String message, Object... params);
void warn(String message, Throwable t, Object... params);
void error(String message, Object... params);
void error(String message, Throwable t, Object... params);
void fatal(String message, Object... params);
void fatal(String message, Throwable t, Object... params);
An example usage:
log.debug("This is the debug message number {0}!", 1);
The implementation of this methods can use java.text.MessageFormat for translating the message and the parameters on the resultant log message, with low cost. An example implementation can be:
public void debug(String message, Object... params) {
if (isDebugEnabled()) {
debug(MessageFormat.format(message, params));
}
}
was:
For getting better source code legibility, I propose the extension of the org.apache.commons.logging.Log interface adding the methods above:
{{
void trace(String message, Object... params);
void trace(String message, Throwable t, Object... params);
void debug(String message, Object... params);
void debug(String message, Throwable t, Object... params);
void info(String message, Object... params);
void info(String message, Throwable t, Object... params);
void warn(String message, Object... params);
void warn(String message, Throwable t, Object... params);
void error(String message, Object... params);
void error(String message, Throwable t, Object... params);
void fatal(String message, Object... params);
void fatal(String message, Throwable t, Object... params);
}}
An example usage:
{{
log.debug("This is the debug message number {0}!", 1);
}}
The implementation of this methods can use java.text.MessageFormat for translating the message and the parameters on the resultant log message, with low cost. An example implementation can be:
{{
public void debug(String message, Object... params) {
if (isDebugEnabled()) {
debug(MessageFormat.format(message, params));
}
}
}}
> Extend the org.apache.commons.logging.Log interface for suitable use
> --------------------------------------------------------------------
>
> Key: LOGGING-121
> URL: https://issues.apache.org/jira/browse/LOGGING-121
> Project: Commons Logging
> Issue Type: Improvement
> Affects Versions: 1.1.1
> Environment: Demands Java 1.5
> Reporter: Fábio Lima Santos
> Priority: Minor
>
> For getting better source code legibility, I propose the extension of the org.apache.commons.logging.Log interface adding the methods above:
> void trace(String message, Object... params);
> void trace(String message, Throwable t, Object... params);
> void debug(String message, Object... params);
> void debug(String message, Throwable t, Object... params);
> void info(String message, Object... params);
> void info(String message, Throwable t, Object... params);
> void warn(String message, Object... params);
> void warn(String message, Throwable t, Object... params);
> void error(String message, Object... params);
> void error(String message, Throwable t, Object... params);
> void fatal(String message, Object... params);
> void fatal(String message, Throwable t, Object... params);
> An example usage:
> log.debug("This is the debug message number {0}!", 1);
> The implementation of this methods can use java.text.MessageFormat for translating the message and the parameters on the resultant log message, with low cost. An example implementation can be:
> public void debug(String message, Object... params) {
> if (isDebugEnabled()) {
> debug(MessageFormat.format(message, params));
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.