You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2009/12/08 16:50:18 UTC

[jira] Closed: (FELIX-1186) Defer the construction of a log message

     [ https://issues.apache.org/jira/browse/FELIX-1186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger closed FELIX-1186.
------------------------------------


SCR 1.2.0 has been released. Close all issues.

> Defer the construction of a log message
> ---------------------------------------
>
>                 Key: FELIX-1186
>                 URL: https://issues.apache.org/jira/browse/FELIX-1186
>             Project: Felix
>          Issue Type: Improvement
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.0.8
>            Reporter: Agemo Cui
>            Assignee: Felix Meschberger
>            Priority: Trivial
>             Fix For: scr-1.2.0
>
>
> There are a lot of log messages at the DEBUG level constructed in the first place.
> My thinking is to put the construction of a message after the threshold of the log level is compared to, which could improve the performance and especially means much on a resource constrained device.
> Since most of the log message is constructed by simply concatenating String values of several objects, the prototype of the method BundleComponentActivator.log(a singleton utility may be better) could be like the following.
> public void log( int level, ComponentMetadata metadata, Throwable ex, Object... objs );
> And because most messages consist of no more than 3 objects, we can even implement 3 more log methods as follows to avoid the creation of an object array.
> public void log( int level, ComponentMetadata metadata, Throwable ex, Object obj );
> public void log( int level, ComponentMetadata metadata, Throwable ex, Object obj0, Object obj1 );
> public void log( int level, ComponentMetadata metadata, Throwable ex, Object obj0, Object obj1, Object obj2 );
> And the final log message can be constructed after "if ( m_logLevel >= level )".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.