Jad*_*ias 5 .net c# debugging logging exception
我正在使用这样的NLog
try
{
// ... some code
}
catch(AException ex)
{
logger.ErrorException(ex.Message, ex);
}
Run Code Online (Sandbox Code Playgroud)
但我希望在调试时看到异常.所以我尝试过:
#if !DEBUG
try
{
#endif
// ... some code
#if !DEBUG
}
catch(AException ex)
{
logger.ErrorException(ex.Message, ex);
}
#endif
Run Code Online (Sandbox Code Playgroud)
有更简洁的方法吗?