diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2018-12-30 17:29:02 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-30 17:29:02 -0500 |
| commit | 1f02cf4b7e13c932bc30968cbb74b71885fd3eb7 (patch) | |
| tree | 2fbf2e570340765abd40b5ad8e491f1f212699c0 /Emby.Server.Implementations/IO/FileRefresher.cs | |
| parent | 7ad023143062c1995178e5700961b553822bd5af (diff) | |
| parent | 4c95aee52eda793d1e013164cc0fde9eb609f894 (diff) | |
Merge pull request #285 from Bond-009/logging
Use Serilog to handle logging
Diffstat (limited to 'Emby.Server.Implementations/IO/FileRefresher.cs')
| -rw-r--r-- | Emby.Server.Implementations/IO/FileRefresher.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/IO/FileRefresher.cs b/Emby.Server.Implementations/IO/FileRefresher.cs index 4be30f8b7..df484d04c 100644 --- a/Emby.Server.Implementations/IO/FileRefresher.cs +++ b/Emby.Server.Implementations/IO/FileRefresher.cs @@ -12,7 +12,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.IO; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Extensions; -using MediaBrowser.Model.Logging; +using Microsoft.Extensions.Logging; using MediaBrowser.Model.System; using MediaBrowser.Model.Tasks; using MediaBrowser.Model.Threading; @@ -38,7 +38,7 @@ namespace Emby.Server.Implementations.IO public FileRefresher(string path, IFileSystem fileSystem, IServerConfigurationManager configurationManager, ILibraryManager libraryManager, ITaskManager taskManager, ILogger logger, ITimerFactory timerFactory, IEnvironmentInfo environmentInfo, ILibraryManager libraryManager1) { - logger.Debug("New file refresher created for {0}", path); + logger.LogDebug("New file refresher created for {0}", path); Path = path; _fileSystem = fileSystem; @@ -108,7 +108,7 @@ namespace Emby.Server.Implementations.IO { lock (_timerLock) { - Logger.Debug("Resetting file refresher from {0} to {1}", Path, path); + Logger.LogDebug("Resetting file refresher from {0} to {1}", Path, path); Path = path; AddAffectedPath(path); @@ -130,7 +130,7 @@ namespace Emby.Server.Implementations.IO paths = _affectedPaths.ToList(); } - Logger.Debug("Timer stopped."); + Logger.LogDebug("Timer stopped."); DisposeTimer(); EventHelper.FireEventIfNotNull(Completed, this, EventArgs.Empty, Logger); @@ -141,7 +141,7 @@ namespace Emby.Server.Implementations.IO } catch (Exception ex) { - Logger.ErrorException("Error processing directory changes", ex); + Logger.LogError(ex, "Error processing directory changes"); } } @@ -161,7 +161,7 @@ namespace Emby.Server.Implementations.IO continue; } - Logger.Info(item.Name + " (" + item.Path + ") will be refreshed."); + Logger.LogInformation("{name} ({path}}) will be refreshed.", item.Name, item.Path); try { @@ -172,11 +172,11 @@ namespace Emby.Server.Implementations.IO // For now swallow and log. // Research item: If an IOException occurs, the item may be in a disconnected state (media unavailable) // Should we remove it from it's parent? - Logger.ErrorException("Error refreshing {0}", ex, item.Name); + Logger.LogError(ex, "Error refreshing {name}", item.Name); } catch (Exception ex) { - Logger.ErrorException("Error refreshing {0}", ex, item.Name); + Logger.LogError(ex, "Error refreshing {name}", item.Name); } } } |
