mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-04 06:48:35 +01:00
Use Microsoft.Extensions.Logging abstraction
This commit is contained in:
@@ -12,7 +12,6 @@ using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Library;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -36,6 +35,7 @@ using MediaBrowser.Model.Providers;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
@@ -798,7 +798,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
builder.Append(chunkBuilder);
|
||||
}
|
||||
//Logger.Debug("ModifySortChunks Start: {0} End: {1}", name, builder.ToString());
|
||||
//logger.LogDebug("ModifySortChunks Start: {0} End: {1}", name, builder.ToString());
|
||||
return builder.ToString().RemoveDiacritics();
|
||||
}
|
||||
|
||||
@@ -1414,7 +1414,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error refreshing owned items for {0}", ex, Path ?? Name);
|
||||
Logger.LogError("Error refreshing owned items for {0}", ex, Path ?? Name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1802,7 +1802,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (!isAllowed)
|
||||
{
|
||||
Logger.Debug("{0} has an unrecognized parental rating of {1}.", Name, rating);
|
||||
Logger.LogDebug("{0} has an unrecognized parental rating of {1}.", Name, rating);
|
||||
}
|
||||
|
||||
return isAllowed;
|
||||
@@ -2058,7 +2058,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (itemByPath == null)
|
||||
{
|
||||
//Logger.Warn("Unable to find linked item at path {0}", info.Path);
|
||||
//Logger.LogWarning("Unable to find linked item at path {0}", info.Path);
|
||||
}
|
||||
|
||||
return itemByPath;
|
||||
@@ -2070,7 +2070,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (item == null)
|
||||
{
|
||||
//Logger.Warn("Unable to find linked item at path {0}", info.Path);
|
||||
//Logger.LogWarning("Unable to find linked item at path {0}", info.Path);
|
||||
}
|
||||
|
||||
return item;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using MediaBrowser.Model.Entities;
|
||||
@@ -15,6 +15,8 @@ using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
/// <summary>
|
||||
@@ -103,7 +105,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error loading library options", ex);
|
||||
Logger.LogError("Error loading library options", ex);
|
||||
|
||||
return new LibraryOptions();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using MediaBrowser.Controller.Channels;
|
||||
using MediaBrowser.Controller.Dto;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
@@ -23,6 +22,7 @@ using MediaBrowser.Model.Serialization;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using MediaBrowser.Controller.Collections;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
@@ -264,7 +264,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// </summary>
|
||||
protected virtual List<BaseItem> LoadChildren()
|
||||
{
|
||||
//Logger.Debug("Loading children from {0} {1} {2}", GetType().Name, Id, Path);
|
||||
//logger.LogDebug("Loading children from {0} {1} {2}", GetType().Name, Id, Path);
|
||||
//just load our children from the repo - the library will be validated and maintained in other processes
|
||||
return GetCachedChildren();
|
||||
}
|
||||
@@ -303,7 +303,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
var id = child.Id;
|
||||
if (dictionary.ContainsKey(id))
|
||||
{
|
||||
Logger.Error("Found folder containing items with duplicate id. Path: {0}, Child Name: {1}",
|
||||
Logger.LogError("Found folder containing items with duplicate id. Path: {0}, Child Name: {1}",
|
||||
Path ?? Name,
|
||||
child.Path ?? child.Name);
|
||||
}
|
||||
@@ -425,7 +425,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
else
|
||||
{
|
||||
Logger.Debug("Removed item: " + item.Path);
|
||||
Logger.LogDebug("Removed item: " + item.Path);
|
||||
|
||||
item.SetParent(null);
|
||||
LibraryManager.DeleteItem(item, new DeleteOptions { DeleteFileLocation = false }, this, false);
|
||||
@@ -795,7 +795,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
if (!(this is ICollectionFolder))
|
||||
{
|
||||
Logger.Debug("Query requires post-filtering due to LinkedChildren. Type: " + GetType().Name);
|
||||
Logger.LogDebug("Query requires post-filtering due to LinkedChildren. Type: " + GetType().Name);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -846,7 +846,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (CollapseBoxSetItems(query, this, query.User, ConfigurationManager))
|
||||
{
|
||||
Logger.Debug("Query requires post-filtering due to CollapseBoxSetItems");
|
||||
Logger.LogDebug("Query requires post-filtering due to CollapseBoxSetItems");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1575,7 +1575,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
try
|
||||
{
|
||||
Logger.Debug("Found shortcut at {0}", i.FullName);
|
||||
Logger.LogDebug("Found shortcut at {0}", i.FullName);
|
||||
|
||||
var resolvedPath = CollectionFolder.ApplicationHost.ExpandVirtualPath(FileSystem.ResolveShortcut(i.FullName));
|
||||
|
||||
@@ -1588,13 +1588,13 @@ namespace MediaBrowser.Controller.Entities
|
||||
};
|
||||
}
|
||||
|
||||
Logger.Error("Error resolving shortcut {0}", i.FullName);
|
||||
Logger.LogError("Error resolving shortcut {0}", i.FullName);
|
||||
|
||||
return null;
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
Logger.ErrorException("Error resolving shortcut {0}", ex, i.FullName);
|
||||
Logger.LogError("Error resolving shortcut {0}", ex, i.FullName);
|
||||
return null;
|
||||
}
|
||||
})
|
||||
@@ -1605,7 +1605,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
if (!newShortcutLinks.SequenceEqual(currentShortcutLinks, new LinkedChildComparer(FileSystem)))
|
||||
{
|
||||
Logger.Info("Shortcut links have changed for {0}", Path);
|
||||
Logger.LogInformation("Shortcut links have changed for {0}", Path);
|
||||
|
||||
newShortcutLinks.AddRange(LinkedChildren.Where(i => i.Type == LinkedChildType.Manual));
|
||||
LinkedChildren = newShortcutLinks.ToArray();
|
||||
|
||||
@@ -363,7 +363,7 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error in FillMissingEpisodeNumbersFromPath. Episode: {0}", ex, Path ?? Name ?? Id.ToString());
|
||||
Logger.LogError(ex, "Error in FillMissingEpisodeNumbersFromPath. Episode: {Episode}", Path ?? Name ?? Id.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Playlists;
|
||||
using MediaBrowser.Controller.TV;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MediaBrowser.Model.Querying;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -262,7 +262,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
catch
|
||||
{
|
||||
// Full exception logged at lower levels
|
||||
_logger.Error("Error getting genre");
|
||||
_logger.LogError("Error getting genre");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
catch
|
||||
{
|
||||
// Full exception logged at lower levels
|
||||
_logger.Error("Error getting genre");
|
||||
_logger.LogError("Error getting genre");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user