felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Felix Meschberger (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FELIX-3180) Provide MessageFormat based logging method
Date Fri, 21 Oct 2011 13:18:31 GMT
Provide MessageFormat based logging method

                 Key: FELIX-3180
                 URL: https://issues.apache.org/jira/browse/FELIX-3180
             Project: Felix
          Issue Type: Improvement
          Components: Configuration Admin
    Affects Versions:  configadmin-1.2.8
            Reporter: Felix Meschberger
            Assignee: Felix Meschberger
             Fix For: configadmin-1.4.0

Currently there is only a single logging method in the ConfigurationManager class:

    log(int level, String message, Throwable t)

This allows fixed strings to be logged at certain levels. If the messages are composed of
dynamic content (e.g. configuration PIDs) this requires String concatenations and thus --
to prevent performance issues -- guarding the calls with isEnabled(int level) calls. This
clutters the code.

To improve this situation a new logging method

   log(int level, String format, Object[] args)

should be added where format is a MessageFormat pattern and args is the MessageFormat argument
vector. The message is generated calling

   MessageFormat.format(format, args)

and the result used as the message argument to the existing log method. If the last entry
in the args array is a Throwable it is used as the Throwable argument to the log method.

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


View raw message