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

@@ -225,7 +225,7 @@ namespace Emby.Server.Implementations.Dto
catch (Exception ex)
{
// Have to use a catch-all unfortunately because some .net image methods throw plain Exceptions
_logger.LogError("Error generating PrimaryImageAspectRatio for {0}", ex, item.Name);
_logger.LogError(ex, "Error generating PrimaryImageAspectRatio for {itemName}", item.Name);
}
}
@@ -547,7 +547,7 @@ namespace Emby.Server.Implementations.Dto
}
catch (Exception ex)
{
_logger.LogError("Error getting {0} image info", ex, type);
_logger.LogError(ex, "Error getting {type} image info", type);
return null;
}
}
@@ -560,7 +560,7 @@ namespace Emby.Server.Implementations.Dto
}
catch (Exception ex)
{
_logger.LogError("Error getting {0} image info for {1}", ex, image.Type, image.Path);
_logger.LogError(ex, "Error getting {imageType} image info for {path}", image.Type, image.Path);
return null;
}
}
@@ -619,7 +619,7 @@ namespace Emby.Server.Implementations.Dto
}
catch (Exception ex)
{
_logger.LogError("Error getting person {0}", ex, c);
_logger.LogError(ex, "Error getting person {0}", c);
return null;
}
@@ -1451,7 +1451,7 @@ namespace Emby.Server.Implementations.Dto
}
catch (Exception ex)
{
//_logger.LogError("Failed to determine primary image aspect ratio for {0}", ex, imageInfo.Path);
_logger.LogError(ex, "Failed to determine primary image aspect ratio for {0}", imageInfo.Path);
return null;
}
}
@@ -1464,7 +1464,7 @@ namespace Emby.Server.Implementations.Dto
}
catch (Exception ex)
{
_logger.LogError("Error in image enhancer: {0}", ex, enhancer.GetType().Name);
_logger.LogError(ex, "Error in image enhancer: {0}", enhancer.GetType().Name);
}
}