aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/IO
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2018-12-20 13:11:26 +0100
committerBond_009 <bond.009@outlook.com>2018-12-30 22:44:39 +0100
commitea4c914123ba8279b9d9fcf7d5318e11f7a3da4c (patch)
tree455bf175270ffd7c1cb8f4e4ea0fb41851f7c59e /Emby.Server.Implementations/IO
parentbf01918659986cc6cbaefaebb67f607aeb1b4400 (diff)
Fix exception logging
Diffstat (limited to 'Emby.Server.Implementations/IO')
-rw-r--r--Emby.Server.Implementations/IO/FileRefresher.cs8
-rw-r--r--Emby.Server.Implementations/IO/LibraryMonitor.cs16
-rw-r--r--Emby.Server.Implementations/IO/ManagedFileSystem.cs6
3 files changed, 15 insertions, 15 deletions
diff --git a/Emby.Server.Implementations/IO/FileRefresher.cs b/Emby.Server.Implementations/IO/FileRefresher.cs
index 6087f3cf2..df484d04c 100644
--- a/Emby.Server.Implementations/IO/FileRefresher.cs
+++ b/Emby.Server.Implementations/IO/FileRefresher.cs
@@ -141,7 +141,7 @@ namespace Emby.Server.Implementations.IO
}
catch (Exception ex)
{
- Logger.LogError("Error processing directory changes", ex);
+ Logger.LogError(ex, "Error processing directory changes");
}
}
@@ -161,7 +161,7 @@ namespace Emby.Server.Implementations.IO
continue;
}
- Logger.LogInformation(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.LogError("Error refreshing {0}", ex, item.Name);
+ Logger.LogError(ex, "Error refreshing {name}", item.Name);
}
catch (Exception ex)
{
- Logger.LogError("Error refreshing {0}", ex, item.Name);
+ Logger.LogError(ex, "Error refreshing {name}", item.Name);
}
}
}
diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs
index 22d1783ed..ca5810fd6 100644
--- a/Emby.Server.Implementations/IO/LibraryMonitor.cs
+++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs
@@ -114,7 +114,7 @@ namespace Emby.Server.Implementations.IO
}
catch (Exception ex)
{
- Logger.LogError("Error in ReportFileSystemChanged for {0}", ex, path);
+ Logger.LogError(ex, "Error in ReportFileSystemChanged for {path}", path);
}
}
}
@@ -354,7 +354,7 @@ namespace Emby.Server.Implementations.IO
}
catch (Exception ex)
{
- Logger.LogError("Error watching path: {0}", ex, path);
+ Logger.LogError(ex, "Error watching path: {path}", path);
}
});
}
@@ -382,7 +382,7 @@ namespace Emby.Server.Implementations.IO
{
using (watcher)
{
- Logger.LogInformation("Stopping directory watching for path {0}", watcher.Path);
+ Logger.LogInformation("Stopping directory watching for path {path}", watcher.Path);
watcher.Created -= watcher_Changed;
watcher.Deleted -= watcher_Changed;
@@ -439,7 +439,7 @@ namespace Emby.Server.Implementations.IO
var ex = e.GetException();
var dw = (FileSystemWatcher)sender;
- Logger.LogError("Error in Directory watcher for: " + dw.Path, ex);
+ Logger.LogError(ex, "Error in Directory watcher for: {path}", dw.Path);
DisposeWatcher(dw, true);
}
@@ -461,7 +461,7 @@ namespace Emby.Server.Implementations.IO
}
catch (Exception ex)
{
- Logger.LogError("Exception in ReportFileSystemChanged. Path: {0}", ex, e.FullPath);
+ Logger.LogError(ex, "Exception in ReportFileSystemChanged. Path: {FullPath}", e.FullPath);
}
}
@@ -487,13 +487,13 @@ namespace Emby.Server.Implementations.IO
{
if (_fileSystem.AreEqual(i, path))
{
- //logger.LogDebug("Ignoring change to {0}", path);
+ Logger.LogDebug("Ignoring change to {path}", path);
return true;
}
if (_fileSystem.ContainsSubPath(i, path))
{
- //logger.LogDebug("Ignoring change to {0}", path);
+ Logger.LogDebug("Ignoring change to {path}", path);
return true;
}
@@ -503,7 +503,7 @@ namespace Emby.Server.Implementations.IO
{
if (_fileSystem.AreEqual(parent, path))
{
- //logger.LogDebug("Ignoring change to {0}", path);
+ Logger.LogDebug("Ignoring change to {path}", path);
return true;
}
}
diff --git a/Emby.Server.Implementations/IO/ManagedFileSystem.cs b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
index 42b9ae23b..8819449b5 100644
--- a/Emby.Server.Implementations/IO/ManagedFileSystem.cs
+++ b/Emby.Server.Implementations/IO/ManagedFileSystem.cs
@@ -175,7 +175,7 @@ namespace Emby.Server.Implementations.IO
path = System.IO.Path.GetFullPath(path);
return path;
}
- catch (ArgumentException ex)
+ catch (ArgumentException)
{
return filePath;
}
@@ -395,7 +395,7 @@ namespace Emby.Server.Implementations.IO
}
catch (Exception ex)
{
- Logger.LogError("Error determining CreationTimeUtc for {0}", ex, info.FullName);
+ Logger.LogError(ex, "Error determining CreationTimeUtc for {FullName}", info.FullName);
return DateTime.MinValue;
}
}
@@ -434,7 +434,7 @@ namespace Emby.Server.Implementations.IO
}
catch (Exception ex)
{
- Logger.LogError("Error determining LastAccessTimeUtc for {0}", ex, info.FullName);
+ Logger.LogError(ex, "Error determining LastAccessTimeUtc for {FullName}", info.FullName);
return DateTime.MinValue;
}
}