From 2e174c03c9a730c1cc90dce4ef0f308fa27efc0f Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 16 Oct 2011 21:09:43 -0700 Subject: [PATCH] ExceptioneerTarget Tweaks --- .../Instrumentation/ExceptioneerTarget.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/NzbDrone.Core/Instrumentation/ExceptioneerTarget.cs b/NzbDrone.Core/Instrumentation/ExceptioneerTarget.cs index c543320f3..3805eda37 100644 --- a/NzbDrone.Core/Instrumentation/ExceptioneerTarget.cs +++ b/NzbDrone.Core/Instrumentation/ExceptioneerTarget.cs @@ -1,5 +1,4 @@ -using System; -using System.Diagnostics; +using System.Diagnostics; using Exceptioneer.WindowsFormsClient; using NLog; using NLog.Targets; @@ -12,17 +11,18 @@ namespace NzbDrone.Core.Instrumentation protected override void Write(LogEventInfo logEvent) { - if (!Debugger.IsAttached && !Process.GetCurrentProcess().ProcessName.Contains("JetBrains")) - { - Logger.Trace("Sending Exception to Exceptioneer. {0}", Process.GetCurrentProcess().ProcessName); + if (logEvent == null || logEvent.Exception == null) return; + if (Debugger.IsAttached || Process.GetCurrentProcess().ProcessName.Contains("JetBrains")) return; + + Logger.Trace("Sending Exception to Exceptioneer. {0}", Process.GetCurrentProcess().ProcessName); + + new Client + { + ApiKey = "43BBF60A-EB2A-4C1C-B09E-422ADF637265", + ApplicationName = "NZBDrone", + CurrentException = logEvent.Exception + }.Submit(); - new Client - { - ApiKey = "43BBF60A-EB2A-4C1C-B09E-422ADF637265", - ApplicationName = "NZBDrone", - CurrentException = logEvent.Exception - }.Submit(); - } } } } \ No newline at end of file