aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Security/PluginSecurityManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/Security/PluginSecurityManager.cs')
-rw-r--r--Emby.Server.Implementations/Security/PluginSecurityManager.cs19
1 files changed, 8 insertions, 11 deletions
diff --git a/Emby.Server.Implementations/Security/PluginSecurityManager.cs b/Emby.Server.Implementations/Security/PluginSecurityManager.cs
index 8d8d6700e..2b1494c39 100644
--- a/Emby.Server.Implementations/Security/PluginSecurityManager.cs
+++ b/Emby.Server.Implementations/Security/PluginSecurityManager.cs
@@ -12,7 +12,7 @@ using MediaBrowser.Controller;
using MediaBrowser.Model.Cryptography;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Serialization;
@@ -51,7 +51,7 @@ namespace Emby.Server.Implementations.Security
/// Initializes a new instance of the <see cref="PluginSecurityManager" /> class.
/// </summary>
public PluginSecurityManager(IServerApplicationHost appHost, IHttpClient httpClient, IJsonSerializer jsonSerializer,
- IApplicationPaths appPaths, ILogManager logManager, IFileSystem fileSystem, ICryptoProvider cryptographyProvider)
+ IApplicationPaths appPaths, ILoggerFactory loggerFactory, IFileSystem fileSystem, ICryptoProvider cryptographyProvider)
{
if (httpClient == null)
{
@@ -64,7 +64,7 @@ namespace Emby.Server.Implementations.Security
_appPaths = appPaths;
_fileSystem = fileSystem;
_cryptographyProvider = cryptographyProvider;
- _logger = logManager.GetLogger("SecurityManager");
+ _logger = loggerFactory.CreateLogger("SecurityManager");
}
/// <summary>
@@ -135,7 +135,7 @@ namespace Emby.Server.Implementations.Security
if (reg == null)
{
var msg = "Result from appstore registration was null.";
- _logger.Error(msg);
+ _logger.LogError(msg);
throw new ArgumentException(msg);
}
if (!String.IsNullOrEmpty(reg.key))
@@ -150,18 +150,15 @@ namespace Emby.Server.Implementations.Security
SaveAppStoreInfo(parameters);
throw;
}
- catch (HttpException e)
+ catch (HttpException ex)
{
- _logger.ErrorException("Error registering appstore purchase {0}", e, parameters ?? "NO PARMS SENT");
+ _logger.LogError(ex, "Error registering appstore purchase {parameters}", parameters ?? "NO PARMS SENT");
- if (e.StatusCode.HasValue && e.StatusCode.Value == HttpStatusCode.PaymentRequired)
- {
- }
throw new Exception("Error registering store sale");
}
- catch (Exception e)
+ catch (Exception ex)
{
- _logger.ErrorException("Error registering appstore purchase {0}", e, parameters ?? "NO PARMS SENT");
+ _logger.LogError(ex, "Error registering appstore purchase {parameters}", parameters ?? "NO PARMS SENT");
SaveAppStoreInfo(parameters);
//TODO - could create a re-try routine on start-up if this file is there. For now we can handle manually.
throw new Exception("Error registering store sale");