mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-27 10:07:10 +00:00
Better fix for Prowl logging issues.
This commit is contained in:
parent
15526ba666
commit
12c2f7193f
3 changed files with 11 additions and 21 deletions
|
@ -10,8 +10,6 @@ public class Prowl : ExternalNotificationBase
|
||||||
{
|
{
|
||||||
private readonly ProwlProvider _prowlProvider;
|
private readonly ProwlProvider _prowlProvider;
|
||||||
|
|
||||||
private readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
|
||||||
|
|
||||||
public Prowl(ConfigProvider configProvider, ProwlProvider prowlProvider)
|
public Prowl(ConfigProvider configProvider, ProwlProvider prowlProvider)
|
||||||
: base(configProvider)
|
: base(configProvider)
|
||||||
{
|
{
|
||||||
|
@ -41,7 +39,7 @@ public override void OnGrab(string message)
|
||||||
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WarnException(ex.Message, ex);
|
_logger.WarnException(ex.Message, ex);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +62,7 @@ public override void OnDownload(string message, Series series)
|
||||||
|
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.WarnException(ex.Message, ex);
|
_logger.WarnException(ex.Message, ex);
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using Growl.Connector;
|
using Growl.Connector;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
|
||||||
|
@ -9,7 +8,7 @@ namespace NzbDrone.Core.Providers
|
||||||
{
|
{
|
||||||
public class GrowlProvider
|
public class GrowlProvider
|
||||||
{
|
{
|
||||||
private readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
private readonly Application _growlApplication = new Application("NzbDrone");
|
private readonly Application _growlApplication = new Application("NzbDrone");
|
||||||
private GrowlConnector _growlConnector;
|
private GrowlConnector _growlConnector;
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using Prowlin;
|
using Prowlin;
|
||||||
|
|
||||||
|
@ -9,12 +7,7 @@ namespace NzbDrone.Core.Providers
|
||||||
{
|
{
|
||||||
public class ProwlProvider
|
public class ProwlProvider
|
||||||
{
|
{
|
||||||
private readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
public ProwlProvider()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual bool Verify(string apiKey)
|
public virtual bool Verify(string apiKey)
|
||||||
{
|
{
|
||||||
|
@ -32,7 +25,7 @@ public virtual bool Verify(string apiKey)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
catch(Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.TraceException(ex.Message, ex);
|
Logger.TraceException(ex.Message, ex);
|
||||||
Logger.Warn("Invalid API Key: {0}", apiKey);
|
Logger.Warn("Invalid API Key: {0}", apiKey);
|
||||||
|
@ -47,11 +40,11 @@ public virtual bool SendNotification(string title, string message, string apiKey
|
||||||
{
|
{
|
||||||
var notification = new Notification
|
var notification = new Notification
|
||||||
{
|
{
|
||||||
Application = "NzbDrone",
|
Application = "NzbDrone",
|
||||||
Description = message,
|
Description = message,
|
||||||
Event = title,
|
Event = title,
|
||||||
Priority = priority,
|
Priority = priority,
|
||||||
Url = url
|
Url = url
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var apiKey in apiKeys.Split(','))
|
foreach (var apiKey in apiKeys.Split(','))
|
||||||
|
@ -67,7 +60,7 @@ public virtual bool SendNotification(string title, string message, string apiKey
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
catch(Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
Logger.TraceException(ex.Message, ex);
|
Logger.TraceException(ex.Message, ex);
|
||||||
Logger.Warn("Invalid API Key(s): {0}", apiKeys);
|
Logger.Warn("Invalid API Key(s): {0}", apiKeys);
|
||||||
|
|
Loading…
Reference in a new issue