logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Spartaco Giubbolini (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4NET-217) Delayed log
Date Wed, 21 Dec 2011 15:53:30 GMT

    [ https://issues.apache.org/jira/browse/LOG4NET-217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13174160#comment-13174160
] 

Spartaco Giubbolini commented on LOG4NET-217:
---------------------------------------------

If log.IsXXXEnable is all you need then you can easily solve it with extension methods, no
need to change the interface, at least for this purpose.
                
> Delayed log
> -----------
>
>                 Key: LOG4NET-217
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-217
>             Project: Log4net
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.2.10
>            Reporter: Fabio Maulo
>            Priority: Minor
>             Fix For: 3.5
>
>
> would be useful an override like this
> ILog.Debug(Func<string> messageDelegate);
> callable as
> log..Debug(()=> MyTimeExpensiveMethod);
> This is to prevent boiled code as
> if(log.IsDebugEnable)
> {
> log..Debug(MyTimeExpensiveMethod());
> }
> Log4Net can call the messageDelegate only when really needed.
> If you want stay in NET2.0 you can create a specific delegate
> public delegate string MessageDelegate;
> Btw, IMO, the new version should target directly .NET3.5.

--
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

        

Mime
View raw message