Fix exception logging

This commit is contained in:
Bond_009
2018-12-20 13:11:26 +01:00
parent bf01918659
commit ea4c914123
123 changed files with 565 additions and 607 deletions

View File

@@ -1414,7 +1414,7 @@ namespace MediaBrowser.Controller.Entities
}
catch (Exception ex)
{
Logger.LogError("Error refreshing owned items for {0}", ex, Path ?? Name);
Logger.LogError(ex, "Error refreshing owned items for {path}", Path ?? Name);
}
}

View File

@@ -105,7 +105,7 @@ namespace MediaBrowser.Controller.Entities
}
catch (Exception ex)
{
Logger.LogError("Error loading library options", ex);
Logger.LogError(ex, "Error loading library options");
return new LibraryOptions();
}

View File

@@ -303,7 +303,7 @@ namespace MediaBrowser.Controller.Entities
var id = child.Id;
if (dictionary.ContainsKey(id))
{
Logger.LogError("Found folder containing items with duplicate id. Path: {0}, Child Name: {1}",
Logger.LogError("Found folder containing items with duplicate id. Path: {path}, Child Name: {ChildName}",
Path ?? Name,
child.Path ?? child.Name);
}

View File

@@ -259,10 +259,9 @@ namespace MediaBrowser.Controller.Entities
{
return _libraryManager.GetGenre(i);
}
catch
catch (Exception ex)
{
// Full exception logged at lower levels
_logger.LogError("Error getting genre");
_logger.LogError(ex, "Error getting genre");
return null;
}
@@ -383,10 +382,9 @@ namespace MediaBrowser.Controller.Entities
{
return _libraryManager.GetGenre(i);
}
catch
catch (Exception ex)
{
// Full exception logged at lower levels
_logger.LogError("Error getting genre");
_logger.LogError(ex, "Error getting genre");
return null;
}

View File

@@ -91,7 +91,7 @@ namespace MediaBrowser.Controller.IO
}
catch (Exception ex)
{
logger.LogError("Error resolving shortcut from {0}", ex, fullName);
logger.LogError(ex, "Error resolving shortcut from {path}", fullName);
}
}
else if (flattenFolderDepth > 0 && isDirectory)

View File

@@ -727,7 +727,6 @@ namespace MediaBrowser.Controller.MediaEncoding
return count;
}
protected void DisposeIsoMount()
{
if (IsoMount != null)

View File

@@ -232,7 +232,7 @@ namespace MediaBrowser.Controller.Net
}
catch (Exception ex)
{
Logger.LogError("Error sending web socket message {0}", ex, Name);
Logger.LogError(ex, "Error sending web socket message {Name}", Name);
DisposeConnection(tuple);
}
}

View File

@@ -337,7 +337,7 @@ namespace MediaBrowser.Controller.Session
}
catch (Exception ex)
{
_logger.LogError("Error reporting playback progress", ex);
_logger.LogError(ex, "Error reporting playback progress");
}
}
@@ -379,7 +379,7 @@ namespace MediaBrowser.Controller.Session
}
catch (Exception ex)
{
_logger.LogError("Error disposing session controller", ex);
_logger.LogError(ex, "Error disposing session controller");
}
}
}