aboutsummaryrefslogtreecommitdiff
path: root/Emby.Drawing/ImageProcessor.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.Drawing/ImageProcessor.cs
parent7ad023143062c1995178e5700961b553822bd5af (diff)
parent4c95aee52eda793d1e013164cc0fde9eb609f894 (diff)
Merge pull request #285 from Bond-009/logging
Use Serilog to handle logging
Diffstat (limited to 'Emby.Drawing/ImageProcessor.cs')
-rw-r--r--Emby.Drawing/ImageProcessor.cs30
1 files changed, 15 insertions, 15 deletions
diff --git a/Emby.Drawing/ImageProcessor.cs b/Emby.Drawing/ImageProcessor.cs
index 495ba99a6..6a67be56d 100644
--- a/Emby.Drawing/ImageProcessor.cs
+++ b/Emby.Drawing/ImageProcessor.cs
@@ -5,7 +5,7 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Serialization;
using System;
using System.Collections.Concurrent;
@@ -261,7 +261,7 @@ namespace Emby.Drawing
//if (originalImageSize.HasValue && options.HasDefaultOptions(originalImagePath, originalImageSize.Value) && !autoOrient)
//{
// // Just spit out the original file if all the options are default
- // _logger.Info("Returning original image {0}", originalImagePath);
+ // _logger.LogInformation("Returning original image {0}", originalImagePath);
// return new ValueTuple<string, string, DateTime>(originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);
//}
@@ -302,7 +302,7 @@ namespace Emby.Drawing
{
// Decoder failed to decode it
#if DEBUG
- _logger.ErrorException("Error encoding image", ex);
+ _logger.LogError(ex, "Error encoding image");
#endif
// Just spit out the original file if all the options are default
return new Tuple<string, string, DateTime>(originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);
@@ -310,7 +310,7 @@ namespace Emby.Drawing
catch (Exception ex)
{
// If it fails for whatever reason, return the original image
- _logger.ErrorException("Error encoding image", ex);
+ _logger.LogError(ex, "Error encoding image");
// Just spit out the original file if all the options are default
return new Tuple<string, string, DateTime>(originalImagePath, MimeTypes.GetMimeType(originalImagePath), dateModified);
@@ -464,7 +464,7 @@ namespace Emby.Drawing
}
var path = info.Path;
- _logger.Info("Getting image size for item {0} {1}", item.GetType().Name, path);
+ _logger.LogInformation("Getting image size for item {0} {1}", item.GetType().Name, path);
var size = GetImageSize(path, allowSlowMethods);
@@ -603,7 +603,7 @@ namespace Emby.Drawing
}
catch (Exception ex)
{
- _logger.ErrorException("Image conversion failed for {0}", ex, originalImagePath);
+ _logger.LogError(ex, "Image conversion failed for {originalImagePath}", originalImagePath);
}
}
@@ -646,21 +646,21 @@ namespace Emby.Drawing
var cacheGuid = GetImageCacheTag(item, image, enhancers);
// Enhance if we have enhancers
- var ehnancedImageInfo = await GetEnhancedImageInternal(originalImagePath, item, imageType, imageIndex, enhancers, cacheGuid, cancellationToken).ConfigureAwait(false);
+ var enhancedImageInfo = await GetEnhancedImageInternal(originalImagePath, item, imageType, imageIndex, enhancers, cacheGuid, cancellationToken).ConfigureAwait(false);
- var ehnancedImagePath = ehnancedImageInfo.Item1;
+ var enhancedImagePath = enhancedImageInfo.Item1;
// If the path changed update dateModified
- if (!string.Equals(ehnancedImagePath, originalImagePath, StringComparison.OrdinalIgnoreCase))
+ if (!string.Equals(enhancedImagePath, originalImagePath, StringComparison.OrdinalIgnoreCase))
{
- var treatmentRequiresTransparency = ehnancedImageInfo.Item2;
+ var treatmentRequiresTransparency = enhancedImageInfo.Item2;
- return new ValueTuple<string, DateTime, bool>(ehnancedImagePath, _fileSystem.GetLastWriteTimeUtc(ehnancedImagePath), treatmentRequiresTransparency);
+ return new ValueTuple<string, DateTime, bool>(enhancedImagePath, _fileSystem.GetLastWriteTimeUtc(enhancedImagePath), treatmentRequiresTransparency);
}
}
catch (Exception ex)
{
- _logger.ErrorException("Error enhancing image", ex);
+ _logger.LogError(ex, "Error enhancing image");
}
return new ValueTuple<string, DateTime, bool>(originalImagePath, dateModified, inputImageSupportsTransparency);
@@ -827,11 +827,11 @@ namespace Emby.Drawing
public void CreateImageCollage(ImageCollageOptions options)
{
- _logger.Info("Creating image collage and saving to {0}", options.OutputPath);
+ _logger.LogInformation("Creating image collage and saving to {0}", options.OutputPath);
_imageEncoder.CreateImageCollage(options);
- _logger.Info("Completed creation of image collage and saved to {0}", options.OutputPath);
+ _logger.LogInformation("Completed creation of image collage and saved to {0}", options.OutputPath);
}
public IImageEnhancer[] GetSupportedEnhancers(BaseItem item, ImageType imageType)
@@ -853,7 +853,7 @@ namespace Emby.Drawing
}
catch (Exception ex)
{
- _logger.ErrorException("Error in image enhancer: {0}", ex, i.GetType().Name);
+ _logger.LogError(ex, "Error in image enhancer: {0}", i.GetType().Name);
}
}