aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/EntryPoints
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2018-12-13 14:18:25 +0100
committerBond_009 <bond.009@outlook.com>2018-12-30 22:44:38 +0100
commit0f8b3c634708ce8e7b2e2ae6fed87b6b943b5bca (patch)
tree3b2440977592f46598ee1961199ec2c0fd3455ac /Emby.Server.Implementations/EntryPoints
parentb0fd432126606d7008544ff0237beabc52109e02 (diff)
Use Microsoft.Extensions.Logging abstraction
Diffstat (limited to 'Emby.Server.Implementations/EntryPoints')
-rw-r--r--Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs8
-rw-r--r--Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs18
-rw-r--r--Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs4
-rw-r--r--Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs6
-rw-r--r--Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs4
-rw-r--r--Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs4
-rw-r--r--Emby.Server.Implementations/EntryPoints/StartupWizard.cs4
-rw-r--r--Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs4
-rw-r--r--Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs6
-rw-r--r--Emby.Server.Implementations/EntryPoints/UsageReporter.cs4
-rw-r--r--Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs2
11 files changed, 32 insertions, 32 deletions
diff --git a/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs
index 561f5ee12..cd5fca40d 100644
--- a/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs
+++ b/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs
@@ -2,7 +2,7 @@
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Tasks;
using System;
using System.Linq;
@@ -65,7 +65,7 @@ namespace Emby.Server.Implementations.EntryPoints
{
DisposeTimer();
- _logger.Info("Automatically restarting the system because it is idle and a restart is required.");
+ _logger.LogInformation("Automatically restarting the system because it is idle and a restart is required.");
try
{
@@ -73,7 +73,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
- _logger.ErrorException("Error restarting server", ex);
+ _logger.LogError("Error restarting server", ex);
}
}
}
@@ -98,7 +98,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
- _logger.ErrorException("Error getting timers", ex);
+ _logger.LogError("Error getting timers", ex);
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
index aa672a1b7..46fbc94fd 100644
--- a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
+++ b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
@@ -9,7 +9,7 @@ using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Events;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Threading;
using Mono.Nat;
using System.Threading;
@@ -29,9 +29,9 @@ namespace Emby.Server.Implementations.EntryPoints
private NatManager _natManager;
- public ExternalPortForwarding(ILogManager logmanager, IServerApplicationHost appHost, IServerConfigurationManager config, IDeviceDiscovery deviceDiscovery, IHttpClient httpClient, ITimerFactory timerFactory)
+ public ExternalPortForwarding(ILoggerFactory loggerFactory, IServerApplicationHost appHost, IServerConfigurationManager config, IDeviceDiscovery deviceDiscovery, IHttpClient httpClient, ITimerFactory timerFactory)
{
- _logger = logmanager.GetLogger("PortMapper");
+ _logger = loggerFactory.CreateLogger("PortMapper");
_appHost = appHost;
_config = config;
_deviceDiscovery = deviceDiscovery;
@@ -84,7 +84,7 @@ namespace Emby.Server.Implementations.EntryPoints
private void Start()
{
- _logger.Debug("Starting NAT discovery");
+ _logger.LogDebug("Starting NAT discovery");
if (_natManager == null)
{
_natManager = new NatManager(_logger, _httpClient);
@@ -139,7 +139,7 @@ namespace Emby.Server.Implementations.EntryPoints
_usnsHandled.Add(identifier);
}
- _logger.Debug("Found NAT device: " + identifier);
+ _logger.LogDebug("Found NAT device: " + identifier);
IPAddress address;
if (IPAddress.TryParse(info.Location.Host, out address))
@@ -216,7 +216,7 @@ namespace Emby.Server.Implementations.EntryPoints
catch
{
// Commenting out because users are reporting problems out of our control
- //_logger.ErrorException("Error creating port forwarding rules", ex);
+ //_logger.LogError("Error creating port forwarding rules", ex);
}
}
@@ -267,7 +267,7 @@ namespace Emby.Server.Implementations.EntryPoints
private Task CreatePortMap(INatDevice device, int privatePort, int publicPort)
{
- _logger.Debug("Creating port map on local port {0} to public port {1} with device {2}", privatePort, publicPort, device.LocalAddress.ToString());
+ _logger.LogDebug("Creating port map on local port {0} to public port {1} with device {2}", privatePort, publicPort, device.LocalAddress.ToString());
return device.CreatePortMap(new Mapping(Protocol.Tcp, privatePort, publicPort)
{
@@ -284,7 +284,7 @@ namespace Emby.Server.Implementations.EntryPoints
private void DisposeNat()
{
- _logger.Debug("Stopping NAT discovery");
+ _logger.LogDebug("Stopping NAT discovery");
if (_timer != null)
{
@@ -309,7 +309,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
- _logger.ErrorException("Error stopping NAT Discovery", ex);
+ _logger.LogError("Error stopping NAT Discovery", ex);
}
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs b/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs
index 8ae85e390..a9121ba32 100644
--- a/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs
+++ b/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs
@@ -1,7 +1,7 @@
using MediaBrowser.Controller;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using System;
using System.Linq;
using MediaBrowser.Model.System;
@@ -49,7 +49,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
- _logger.ErrorException("Error resetting system standby timer", ex);
+ _logger.LogError("Error resetting system standby timer", ex);
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
index 9a2ae34bc..ff283667b 100644
--- a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -331,7 +331,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
- _logger.ErrorException("Error in GetLibraryUpdateInfo", ex);
+ _logger.LogError("Error in GetLibraryUpdateInfo", ex);
return;
}
@@ -346,7 +346,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
- _logger.ErrorException("Error sending LibraryChanged message", ex);
+ _logger.LogError("Error sending LibraryChanged message", ex);
}
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs
index d41d76c6b..24cd659e1 100644
--- a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs
@@ -5,7 +5,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.EntryPoints
{
@@ -66,7 +66,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
- _logger.ErrorException("Error sending message", ex);
+ _logger.LogError("Error sending message", ex);
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs b/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs
index e5748989e..f6a74c4ec 100644
--- a/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs
@@ -163,7 +163,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception)
{
- //Logger.ErrorException("Error sending message", ex);
+ //Logger.LogError("Error sending message", ex);
}
}
@@ -179,7 +179,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception)
{
- //Logger.ErrorException("Error sending message", ex);
+ //Logger.LogError("Error sending message", ex);
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
index 6d73f98ad..ffd98bf78 100644
--- a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
+++ b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
@@ -1,7 +1,7 @@
using Emby.Server.Implementations.Browser;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Plugins;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using MediaBrowser.Controller.Configuration;
namespace Emby.Server.Implementations.EntryPoints
@@ -61,4 +61,4 @@ namespace Emby.Server.Implementations.EntryPoints
{
}
}
-} \ No newline at end of file
+}
diff --git a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
index 5edc5fade..1bb11ce40 100644
--- a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
+++ b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
@@ -1,7 +1,7 @@
using System;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Plugins;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Serialization;
using Emby.Server.Implementations.Udp;
using MediaBrowser.Model.Net;
@@ -58,7 +58,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
- _logger.ErrorException("Failed to start UDP Server", ex);
+ _logger.LogError("Failed to start UDP Server", ex);
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs
index 450764040..ca79262b0 100644
--- a/Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs
+++ b/Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs
@@ -3,7 +3,7 @@ using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -91,7 +91,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
- //_logger.ErrorException("Error sending anonymous usage statistics.", ex);
+ //_logger.LogError("Error sending anonymous usage statistics.", ex);
}
}
@@ -119,7 +119,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
catch (Exception ex)
{
- //_logger.ErrorException("Error sending anonymous usage statistics.", ex);
+ //_logger.LogError("Error sending anonymous usage statistics.", ex);
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/UsageReporter.cs b/Emby.Server.Implementations/EntryPoints/UsageReporter.cs
index d9c9e1a40..e962bb59b 100644
--- a/Emby.Server.Implementations/EntryPoints/UsageReporter.cs
+++ b/Emby.Server.Implementations/EntryPoints/UsageReporter.cs
@@ -9,7 +9,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.EntryPoints
{
@@ -75,7 +75,7 @@ namespace Emby.Server.Implementations.EntryPoints
throw new ArgumentException("Client info must have a device Id");
}
- _logger.Info("App Activity: app: {0}, version: {1}, deviceId: {2}, deviceName: {3}",
+ _logger.LogInformation("App Activity: app: {0}, version: {1}, deviceId: {2}, deviceName: {3}",
app.AppName ?? "Unknown App",
app.AppVersion ?? "Unknown",
app.DeviceId,
diff --git a/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs b/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
index 36e29e46a..58309ea1c 100644
--- a/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Session;
using System;
using System.Collections.Generic;