aboutsummaryrefslogtreecommitdiff
path: root/Emby.Notifications/NotificationManager.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2018-12-30 17:29:02 -0500
committerGitHub <noreply@github.com>2018-12-30 17:29:02 -0500
commit1f02cf4b7e13c932bc30968cbb74b71885fd3eb7 (patch)
tree2fbf2e570340765abd40b5ad8e491f1f212699c0 /Emby.Notifications/NotificationManager.cs
parent7ad023143062c1995178e5700961b553822bd5af (diff)
parent4c95aee52eda793d1e013164cc0fde9eb609f894 (diff)
Merge pull request #285 from Bond-009/logging
Use Serilog to handle logging
Diffstat (limited to 'Emby.Notifications/NotificationManager.cs')
-rw-r--r--Emby.Notifications/NotificationManager.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/Emby.Notifications/NotificationManager.cs b/Emby.Notifications/NotificationManager.cs
index bb348d267..fa8fdd9c1 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(ex, "Error sending notification to {0}", service.Name);
}
}
@@ -146,7 +146,7 @@ namespace Emby.Notifications
}
catch (Exception ex)
{
- _logger.ErrorException("Error in IsEnabledForUser", ex);
+ _logger.LogError(ex, "Error in IsEnabledForUser");
return false;
}
}
@@ -177,7 +177,7 @@ namespace Emby.Notifications
}
catch (Exception ex)
{
- _logger.ErrorException("Error in GetNotificationTypes", ex);
+ _logger.LogError(ex, "Error in GetNotificationTypes");
return new List<NotificationTypeInfo>();
}