avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20187] - log(pri,msg) does not check enabled flag
Date Sun, 25 May 2003 14:52:21 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20187>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20187

log(pri,msg) does not check enabled flag

leo.sutic@inspireinfrastructure.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



------- Additional Comments From leo.sutic@inspireinfrastructure.com  2003-05-25 14:52 -------
This is fine, because the method called ( log (Priority,String,Throwable) ) 
does the testing. So if we did the test in log(Priority,String) as well, we'd 
have *two* tests for successful logging requests.

What we optimize away with the patch is one method call for failed logging 
requests, but you add one call to check - so the optimization might just make 
things run slower as you trade:

    public final void log( final Priority priority, final String message )
    {
        // Maybe Inlined - 1 or 0 method calls
        if( m_priority.isLowerOrEqual( priority ) )  // 1 call
        {
            output( priority, message, null );       // 1 call, conditional
        }
    }

method calls: worst: 3, best: 1

for:

    public final void log( final Priority priority, final String message )
    {
        if( m_priority.isLowerOrEqual( priority ) )  // 1 call
        {
            // Maybe Inlined - 1 or 0 method calls
            if( m_priority.isLowerOrEqual( priority ) )  // 1 call
            {
                output( priority, message, null );       // 1 call
            }
        }
    }

method calls: worst: 4, best: 1

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Mime
View raw message