diff options
| author | Bond_009 <bond.009@outlook.com> | 2018-12-13 14:18:25 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2018-12-30 22:44:38 +0100 |
| commit | 0f8b3c634708ce8e7b2e2ae6fed87b6b943b5bca (patch) | |
| tree | 3b2440977592f46598ee1961199ec2c0fd3455ac /Emby.Notifications | |
| parent | b0fd432126606d7008544ff0237beabc52109e02 (diff) | |
Use Microsoft.Extensions.Logging abstraction
Diffstat (limited to 'Emby.Notifications')
| -rw-r--r-- | Emby.Notifications/NotificationManager.cs | 14 | ||||
| -rw-r--r-- | Emby.Notifications/Notifications.cs | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/Emby.Notifications/NotificationManager.cs b/Emby.Notifications/NotificationManager.cs index bb348d267..209bc82aa 100644 --- a/Emby.Notifications/NotificationManager.cs +++ b/Emby.Notifications/NotificationManager.cs @@ -4,7 +4,7 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Notifications; -using MediaBrowser.Model.Logging; +using Microsoft.Extensions.Logging; using MediaBrowser.Model.Notifications; using System; using System.Collections.Generic; @@ -25,11 +25,11 @@ namespace Emby.Notifications private INotificationService[] _services; private INotificationTypeFactory[] _typeFactories; - public NotificationManager(ILogManager logManager, IUserManager userManager, IServerConfigurationManager config) + public NotificationManager(ILoggerFactory loggerFactory, IUserManager userManager, IServerConfigurationManager config) { _userManager = userManager; _config = config; - _logger = logManager.GetLogger(GetType().Name); + _logger = loggerFactory.CreateLogger(GetType().Name); } private NotificationOptions GetConfiguration() @@ -126,7 +126,7 @@ namespace Emby.Notifications User = user }; - _logger.Debug("Sending notification via {0} to user {1}", service.Name, user.Name); + _logger.LogDebug("Sending notification via {0} to user {1}", service.Name, user.Name); try { @@ -134,7 +134,7 @@ namespace Emby.Notifications } catch (Exception ex) { - _logger.ErrorException("Error sending notification to {0}", ex, service.Name); + _logger.LogError("Error sending notification to {0}", ex, service.Name); } } @@ -146,7 +146,7 @@ namespace Emby.Notifications } catch (Exception ex) { - _logger.ErrorException("Error in IsEnabledForUser", ex); + _logger.LogError("Error in IsEnabledForUser", ex); return false; } } @@ -177,7 +177,7 @@ namespace Emby.Notifications } catch (Exception ex) { - _logger.ErrorException("Error in GetNotificationTypes", ex); + _logger.LogError("Error in GetNotificationTypes", ex); return new List<NotificationTypeInfo>(); } diff --git a/Emby.Notifications/Notifications.cs b/Emby.Notifications/Notifications.cs index 3cadad6c8..ab78f9f91 100644 --- a/Emby.Notifications/Notifications.cs +++ b/Emby.Notifications/Notifications.cs @@ -8,7 +8,7 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Notifications; using MediaBrowser.Controller.Plugins; using MediaBrowser.Controller.Session; -using MediaBrowser.Model.Logging; +using Microsoft.Extensions.Logging; using MediaBrowser.Model.Notifications; using MediaBrowser.Model.Tasks; using System; @@ -273,7 +273,7 @@ namespace Emby.Notifications } catch (Exception ex) { - _logger.ErrorException("Error sending notification", ex); + _logger.LogError("Error sending notification", ex); } } |
