[jboss-jira] [JBoss JIRA] (LOGTOOL-34) FQCN methods are not completely correct

David Lloyd (Resolved) (JIRA) jira-events at lists.jboss.org
Thu Oct 20 19:26:45 EDT 2011


     [ https://issues.jboss.org/browse/LOGTOOL-34?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Lloyd resolved LOGTOOL-34.
--------------------------------

    Resolution: Done


Fixed by introducing base class into jboss logging.  Generated BasicLogger implementations will extend the base class.
                
> FQCN methods are not completely correct
> ---------------------------------------
>
>                 Key: LOGTOOL-34
>                 URL: https://issues.jboss.org/browse/LOGTOOL-34
>             Project: Log Tool
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>            Reporter: David Lloyd
>            Assignee: David Lloyd
>             Fix For: 1.0.0.CR3
>
>
> The generated code which looks like this:
> {code}
>     // ...snip...
>     @Override
>     public final void log(final org.jboss.logging.Logger.Level arg0, final String arg1, final Object arg2, final Throwable arg3) {
>         log.logv(FQCN, arg0, arg3, arg1, (arg2 == null ? null : arg2.toString()));
>     }
>     @Override
>     public final void debugf(final String arg0, final Object arg1) {
>         log.logf(FQCN, (Logger.Level.DEBUG), null, arg0, (arg1 == null ? null : arg1.toString()));
>     }
>     @Override
>     public final void debugv(final String arg0, final Object arg1) {
>         log.logv(FQCN, (Logger.Level.DEBUG), null, arg0, (arg1 == null ? null : arg1.toString()));
>     }
>     @Override
>     public final void tracef(final String arg0, final Object arg1) {
>         log.logf(FQCN, (Logger.Level.TRACE), null, arg0, (arg1 == null ? null : arg1.toString()));
>     }
>     @Override
>     public final void debug(final Object arg0) {
>         log.logv(FQCN, (Logger.Level.DEBUG), null, (arg0 == null ? null : arg0.toString()));
>     }
>     // ...snip...
>     @Override
>     public final void errorv(final String arg0, Object... arg1) {
>         log.logv(FQCN, (Logger.Level.ERROR), null, arg0, (arg1 == null ? null : arg1.toString()));
>     }
> {code}
> ...should look like this:
> {code}
>     // ...snip...
>     @Override
>     public final void log(final Logger.Level level, final String loggerFqcn, final Object message, final Throwable cause) {
>         log.log(level, loggerFqcn, message, cause);
>     }
>     @Override
>     public final void debugf(final String format, final Object param1) {
>         log.logf(FQCN, Logger.Level.DEBUG, null, format, param1);
>     }
>     @Override
>     public final void debugv(final String format, final Object param1) {
>         log.logv(FQCN, Logger.Level.DEBUG, null, format, param1);
>     }
>     @Override
>     public final void tracef(final String format, final Object param1) {
>         log.logf(FQCN, Logger.Level.TRACE, null, format, param1);
>     }
>     @Override
>     public final void debug(final Object message) {
>         log.log(FQCN, Logger.Level.DEBUG, message, null, null);
>     }
>     // ...snip...
>     @Override
>     public final void errorv(final String format, Object... params) {
>         log.logv(FQCN, Logger.Level.ERROR, null, format, params);
>     }
> {code}
> Note:
> # Removal of extra parens around level and arg expressions
> # Rename arg0 to "format" or "message" as appropriate
> # Use log.log instead of log.logv for debug(Object) impl (debugv->logv, debugf->logf, debug->log)
> # Eliminate the toString on params (especially varargs which won't work at all)
> # Rename arg1..n to "param1..n" to be consistent with the declaration
> # Rename arg1 to "params" on varargs methods
> # Shortened "org.jboss.logging.Logger.Level" to "Logger.Level" in parameter lists
> # Made sure that the "loggerFqcn" parameter is properly propagated on those BasicLogger methods which use it (see the corrected log() definition, note that FQCN is not used here)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list