You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Dominik Psenner (JIRA)" <ji...@apache.org> on 2013/10/03 13:11:43 UTC

[jira] [Comment Edited] (LOG4NET-394) Lambda-based ILog-Extensions should catch errors

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

Dominik Psenner edited comment on LOG4NET-394 at 10/3/13 11:10 AM:
-------------------------------------------------------------------

What do you expect to happen if you write this somewhere in your application:

ILog logger;
[...]
logger.DebugExt(null);

or

ILog logger;
[...]
logger.DebugExt(() => 123/0);

As I see it, log4net should not silently ignore erroneous code which is part of a lambda expression since log4net is not responsible of the lambda expression just alike log4net is not responsible if someone writes this:

ILog logger;
[...]
logger.Debug(123/0);


was (Author: nachbarslumpi):
What do you expect to happen if you write this somewhere in your application:

ILog logger;
[...]
logger.DebugExt(null);

or

ILog logger;
[...]
logger.DebugExt(() => 123/0);

As I see it, log4net should not silently ignore erroneous code which is part of a lambda expression since log4net is not responsible of the lambda expression just alike log4net is not responsible if someone writes this:

ILog logger;
logger.Debug(123/0);

> Lambda-based ILog-Extensions should catch errors
> ------------------------------------------------
>
>                 Key: LOG4NET-394
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-394
>             Project: Log4net
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.2.12
>            Reporter: Gian Marco Gherardi
>            Priority: Minor
>
> The new lambda syntax introduced with LOG4NET-290 allow wrapping log related code in a lambda to be executed only if necessary. In the log4net spirit of being a reliable logging system (see http://logging.apache.org/log4net/release/faq.html) also the log related code contained in the lambda should not block application by throwing exception and so the lambda execution shluld be wrapped in a try...catch



--
This message was sent by Atlassian JIRA
(v6.1#6144)