[
https://issues.apache.org/jira/browse/LOG4NET-675?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17452044#comment-17452044
]
Erik Mavrinac commented on LOG4NET-675:
---------------------------------------
This is not how conditional compilation works - conditional compilation only
works within your code, not in the code of an assembly you are using from a
package. If you call the DebugAppender, it will always call Debug.Write. You'll
need to rewrite your code to disable DebugAppender when you are building a
release version of your code.
> DebugAppender does not suppress log writing if DEBUG symbol is not defined
> --------------------------------------------------------------------------
>
> Key: LOG4NET-675
> URL: https://issues.apache.org/jira/browse/LOG4NET-675
> Project: Log4net
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 1.2.12
> Reporter: Ken Varn
> Priority: Major
>
> My C# project uses the DebugAppender in addition to other appenders. My
> intent was to only have logs written to the DebugAppender when the DEBUG
> preprocessor symbol is defined. However, to my surprise, the DebugAppender
> still writes the Debug output even if DEBUG symbol isn't defined.
> I would think that the DebugAppender should follow the same rules as and the
> System.Diagnostics.Debug.Writexxxx methods in that the
> [System.Diagnostics.Conditional("DEBUG")] attribute would be incorporated.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)