[jboss-jira] [JBoss JIRA] Created: (JBLOGGING-64) Detect parameters being inconsistent with log message template

Sanne Grinovero (JIRA) jira-events at lists.jboss.org
Mon Jun 13 06:50:23 EDT 2011


Detect parameters being inconsistent with log message template
--------------------------------------------------------------

                 Key: JBLOGGING-64
                 URL: https://issues.jboss.org/browse/JBLOGGING-64
             Project: JBoss Logging
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
            Reporter: Sanne Grinovero
            Assignee: David Lloyd


In both Infinispan and Hibernate we had reports of issues following the same patterns, as in code like:
{code}
@LogMessage(level = ERROR)
@Message(id = 21, value = "Unable to synchronize source of %s for entity %s")
void unableToSynchronizeSource(String indexName, @Cause Exception e);
{code}
People might do mistakes in the string template, forget to pass enough parameters, or not use the positional _%1$s_ variants. We can hardly write tests to cover all log messages, while I think it would be quite cool if the annotation processor could verify messages consistency with parameters at compile time.
It would be just awesome if it could check for type consistency as well.



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list