Use Microsoft.Extensions.Logging abstraction

This commit is contained in:
Bond_009
2018-12-13 14:18:25 +01:00
parent b0fd432126
commit 0f8b3c6347
310 changed files with 1421 additions and 2058 deletions

View File

@@ -0,0 +1,46 @@
using MediaBrowser.Common.Events;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Connect;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Connect;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Users;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Cryptography;
using MediaBrowser.Model.IO;
using MediaBrowser.Controller.Authentication;
using MediaBrowser.Controller.Security;
using MediaBrowser.Controller.Devices;
using MediaBrowser.Controller.Session;
using MediaBrowser.Controller.Plugins;
namespace Emby.Server.Implementations.Library
{
public class ConnectManager : IConnectManager
{
public ConnectManager()
{
}
}
}

View File

@@ -9,7 +9,7 @@ using System.Linq;
using MediaBrowser.Controller.IO;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library
{

View File

@@ -12,7 +12,7 @@ using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Querying;
using Emby.Naming.Audio;
using Emby.Naming.Common;
@@ -351,7 +351,7 @@ namespace Emby.Server.Implementations.Library
if (item is LiveTvProgram)
{
_logger.Debug("Deleting item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
_logger.LogDebug("Deleting item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
item.GetType().Name,
item.Name ?? "Unknown name",
item.Path ?? string.Empty,
@@ -359,7 +359,7 @@ namespace Emby.Server.Implementations.Library
}
else
{
_logger.Info("Deleting item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
_logger.LogInformation("Deleting item, Type: {0}, Name: {1}, Path: {2}, Id: {3}",
item.GetType().Name,
item.Name ?? "Unknown name",
item.Path ?? string.Empty,
@@ -372,7 +372,7 @@ namespace Emby.Server.Implementations.Library
foreach (var metadataPath in GetMetadataPaths(item, children))
{
_logger.Debug("Deleting path {0}", metadataPath);
_logger.LogDebug("Deleting path {0}", metadataPath);
try
{
@@ -384,7 +384,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error deleting {0}", ex, metadataPath);
_logger.LogError("Error deleting {0}", ex, metadataPath);
}
}
@@ -400,12 +400,12 @@ namespace Emby.Server.Implementations.Library
{
if (fileSystemInfo.IsDirectory)
{
_logger.Debug("Deleting path {0}", fileSystemInfo.FullName);
_logger.LogDebug("Deleting path {0}", fileSystemInfo.FullName);
_fileSystem.DeleteDirectory(fileSystemInfo.FullName, true);
}
else
{
_logger.Debug("Deleting path {0}", fileSystemInfo.FullName);
_logger.LogDebug("Deleting path {0}", fileSystemInfo.FullName);
_fileSystem.DeleteFile(fileSystemInfo.FullName);
}
}
@@ -489,7 +489,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error in {0} resolving {1}", ex, resolver.GetType().Name, args.Path);
_logger.LogError("Error in {0} resolving {1}", ex, resolver.GetType().Name, args.Path);
return null;
}
}
@@ -587,7 +587,7 @@ namespace Emby.Server.Implementations.Library
{
if (parent != null && parent.IsPhysicalRoot)
{
_logger.ErrorException("Error in GetFilteredFileSystemEntries isPhysicalRoot: {0} IsVf: {1}", ex, isPhysicalRoot, isVf);
_logger.LogError("Error in GetFilteredFileSystemEntries isPhysicalRoot: {0} IsVf: {1}", ex, isPhysicalRoot, isVf);
files = new FileSystemMetadata[] { };
}
@@ -639,7 +639,7 @@ namespace Emby.Server.Implementations.Library
foreach (var dupe in dupes)
{
_logger.Info("Found duplicate path: {0}", dupe);
_logger.LogInformation("Found duplicate path: {0}", dupe);
}
var newList = list.Except(dupes, StringComparer.OrdinalIgnoreCase).Select(_fileSystem.GetDirectoryInfo).ToList();
@@ -713,7 +713,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error resolving path {0}", ex, f.FullName);
_logger.LogError("Error resolving path {0}", ex, f.FullName);
return null;
}
}).Where(i => i != null);
@@ -735,7 +735,7 @@ namespace Emby.Server.Implementations.Library
// In case program data folder was moved
if (!string.Equals(rootFolder.Path, rootFolderPath, StringComparison.Ordinal))
{
_logger.Info("Resetting root folder path to {0}", rootFolderPath);
_logger.LogInformation("Resetting root folder path to {0}", rootFolderPath);
rootFolder.Path = rootFolderPath;
}
@@ -805,7 +805,7 @@ namespace Emby.Server.Implementations.Library
// In case program data folder was moved
if (!string.Equals(tmpItem.Path, userRootPath, StringComparison.Ordinal))
{
_logger.Info("Resetting user root folder path to {0}", userRootPath);
_logger.LogInformation("Resetting user root folder path to {0}", userRootPath);
tmpItem.Path = userRootPath;
}
@@ -827,7 +827,7 @@ namespace Emby.Server.Implementations.Library
throw new ArgumentNullException("path");
}
//_logger.Info("FindByPath {0}", path);
//_logger.LogInformation("FindByPath {0}", path);
var query = new InternalItemsQuery
{
@@ -1080,7 +1080,7 @@ namespace Emby.Server.Implementations.Library
private async Task PerformLibraryValidation(IProgress<double> progress, CancellationToken cancellationToken)
{
_logger.Info("Validating media library");
_logger.LogInformation("Validating media library");
await ValidateTopLibraryFolders(cancellationToken).ConfigureAwait(false);
@@ -1135,7 +1135,7 @@ namespace Emby.Server.Implementations.Library
progress.Report(innerPercent);
});
_logger.Debug("Running post-scan task {0}", task.GetType().Name);
_logger.LogDebug("Running post-scan task {0}", task.GetType().Name);
try
{
@@ -1143,12 +1143,12 @@ namespace Emby.Server.Implementations.Library
}
catch (OperationCanceledException)
{
_logger.Info("Post-scan task cancelled: {0}", task.GetType().Name);
_logger.LogInformation("Post-scan task cancelled: {0}", task.GetType().Name);
throw;
}
catch (Exception ex)
{
_logger.ErrorException("Error running postscan task", ex);
_logger.LogError("Error running postscan task", ex);
}
numComplete++;
@@ -1199,7 +1199,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error resolving shortcut file {0}", ex, i);
_logger.LogError("Error resolving shortcut file {0}", ex, i);
return null;
}
})
@@ -1262,7 +1262,7 @@ namespace Emby.Server.Implementations.Library
item = RetrieveItem(id);
//_logger.Debug("GetitemById {0}", id);
//_logger.LogDebug("GetitemById {0}", id);
if (item != null)
{
@@ -1440,7 +1440,7 @@ namespace Emby.Server.Implementations.Library
return true;
}
//_logger.Debug("Query requires ancestor query due to type: " + i.GetType().Name);
//_logger.LogDebug("Query requires ancestor query due to type: " + i.GetType().Name);
return false;
}))
@@ -1506,7 +1506,7 @@ namespace Emby.Server.Implementations.Library
return true;
}
//_logger.Debug("Query requires ancestor query due to type: " + i.GetType().Name);
//_logger.LogDebug("Query requires ancestor query due to type: " + i.GetType().Name);
return false;
}))
@@ -1650,7 +1650,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error getting intros", ex);
_logger.LogError("Error getting intros", ex);
return new List<IntroInfo>();
}
@@ -1670,7 +1670,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error getting intro files", ex);
_logger.LogError("Error getting intro files", ex);
return new List<string>();
}
@@ -1693,7 +1693,7 @@ namespace Emby.Server.Implementations.Library
if (video == null)
{
_logger.Error("Unable to locate item with Id {0}.", info.ItemId.Value);
_logger.LogError("Unable to locate item with Id {0}.", info.ItemId.Value);
}
}
else if (!string.IsNullOrEmpty(info.Path))
@@ -1705,7 +1705,7 @@ namespace Emby.Server.Implementations.Library
if (video == null)
{
_logger.Error("Intro resolver returned null for {0}.", info.Path);
_logger.LogError("Intro resolver returned null for {0}.", info.Path);
}
else
{
@@ -1724,12 +1724,12 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error resolving path {0}.", ex, info.Path);
_logger.LogError("Error resolving path {0}.", ex, info.Path);
}
}
else
{
_logger.Error("IntroProvider returned an IntroInfo with null Path and ItemId.");
_logger.LogError("IntroProvider returned an IntroInfo with null Path and ItemId.");
}
return video;
@@ -1873,7 +1873,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error in ItemAdded event handler", ex);
_logger.LogError("Error in ItemAdded event handler", ex);
}
}
}
@@ -1904,7 +1904,7 @@ namespace Emby.Server.Implementations.Library
}
//var logName = item.LocationType == LocationType.Remote ? item.Name ?? item.Path : item.Path ?? item.Name;
//_logger.Debug("Saving {0} to database.", logName);
//_logger.LogDebug("Saving {0} to database.", logName);
ItemRepository.SaveItems(items, cancellationToken);
@@ -1929,7 +1929,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error in ItemUpdated event handler", ex);
_logger.LogError("Error in ItemUpdated event handler", ex);
}
}
}
@@ -1965,7 +1965,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error in ItemRemoved event handler", ex);
_logger.LogError("Error in ItemRemoved event handler", ex);
}
}
}
@@ -2808,7 +2808,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error getting person", ex);
_logger.LogError("Error getting person", ex);
return null;
}
@@ -2836,7 +2836,7 @@ namespace Emby.Server.Implementations.Library
{
try
{
_logger.Debug("ConvertImageToLocal item {0} - image url: {1}", item.Id, url);
_logger.LogDebug("ConvertImageToLocal item {0} - image url: {1}", item.Id, url);
await _providerManagerFactory().SaveImage(item, url, image.Type, imageIndex, CancellationToken.None).ConfigureAwait(false);

View File

@@ -7,7 +7,7 @@ using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.MediaInfo;
using System.Collections.Generic;
using MediaBrowser.Model.Serialization;
@@ -48,7 +48,7 @@ namespace Emby.Server.Implementations.Library
{
mediaInfo = _json.DeserializeFromFile<MediaInfo>(cacheFilePath);
//_logger.Debug("Found cached media info");
//_logger.LogDebug("Found cached media info");
}
catch
{
@@ -63,7 +63,7 @@ namespace Emby.Server.Implementations.Library
delayMs = Math.Max(3000, delayMs);
if (delayMs > 0)
{
_logger.Info("Waiting {0}ms before probing the live stream", delayMs);
_logger.LogInformation("Waiting {0}ms before probing the live stream", delayMs);
await Task.Delay(delayMs, cancellationToken).ConfigureAwait(false);
}
}
@@ -83,7 +83,7 @@ namespace Emby.Server.Implementations.Library
Directory.CreateDirectory(Path.GetDirectoryName(cacheFilePath));
_json.SerializeToFile(mediaInfo, cacheFilePath);
//_logger.Debug("Saved media info to {0}", cacheFilePath);
//_logger.LogDebug("Saved media info to {0}", cacheFilePath);
}
}
@@ -104,7 +104,7 @@ namespace Emby.Server.Implementations.Library
mediaStreams = newList;
}
_logger.Info("Live tv media info probe took {0} seconds", (DateTime.UtcNow - now).TotalSeconds.ToString(CultureInfo.InvariantCulture));
_logger.LogInformation("Live tv media info probe took {0} seconds", (DateTime.UtcNow - now).TotalSeconds.ToString(CultureInfo.InvariantCulture));
mediaSource.Bitrate = mediaInfo.Bitrate;
mediaSource.Container = mediaInfo.Container;

View File

@@ -6,7 +6,7 @@ using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Serialization;
using System;
@@ -255,7 +255,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error getting media sources", ex);
_logger.LogError("Error getting media sources", ex);
return new List<MediaSourceInfo>();
}
}
@@ -476,12 +476,12 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error probing live tv stream", ex);
_logger.LogError("Error probing live tv stream", ex);
AddMediaInfo(mediaSource, isAudio);
}
var json = _jsonSerializer.SerializeToString(mediaSource);
_logger.Info("Live stream opened: " + json);
_logger.LogInformation("Live stream opened: " + json);
var clone = _jsonSerializer.DeserializeFromString<MediaSourceInfo>(json);
if (!request.UserId.Equals(Guid.Empty))
@@ -624,7 +624,7 @@ namespace Emby.Server.Implementations.Library
{
mediaInfo = _jsonSerializer.DeserializeFromFile<MediaInfo>(cacheFilePath);
//_logger.Debug("Found cached media info");
//_logger.LogDebug("Found cached media info");
}
catch (Exception ex)
{
@@ -658,7 +658,7 @@ namespace Emby.Server.Implementations.Library
_fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(cacheFilePath));
_jsonSerializer.SerializeToFile(mediaInfo, cacheFilePath);
//_logger.Debug("Saved media info to {0}", cacheFilePath);
//_logger.LogDebug("Saved media info to {0}", cacheFilePath);
}
}
@@ -679,7 +679,7 @@ namespace Emby.Server.Implementations.Library
mediaStreams = newList;
}
_logger.Info("Live tv media info probe took {0} seconds", (DateTime.UtcNow - now).TotalSeconds.ToString(CultureInfo.InvariantCulture));
_logger.LogInformation("Live tv media info probe took {0} seconds", (DateTime.UtcNow - now).TotalSeconds.ToString(CultureInfo.InvariantCulture));
mediaSource.Bitrate = mediaInfo.Bitrate;
mediaSource.Container = mediaInfo.Container;
@@ -815,16 +815,16 @@ namespace Emby.Server.Implementations.Library
{
liveStream.ConsumerCount--;
_logger.Info("Live stream {0} consumer count is now {1}", liveStream.OriginalStreamId, liveStream.ConsumerCount);
_logger.LogInformation("Live stream {0} consumer count is now {1}", liveStream.OriginalStreamId, liveStream.ConsumerCount);
if (liveStream.ConsumerCount <= 0)
{
_openStreams.Remove(id);
_logger.Info("Closing live stream {0}", id);
_logger.LogInformation("Closing live stream {0}", id);
await liveStream.Close().ConfigureAwait(false);
_logger.Info("Live stream {0} closed successfully", id);
_logger.LogInformation("Live stream {0} closed successfully", id);
}
}
}
@@ -883,4 +883,4 @@ namespace Emby.Server.Implementations.Library
}
}
}
}
}

View File

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using Emby.Naming.Audio;
using System;
using System.Collections.Generic;
@@ -128,7 +128,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
{
if (IsMultiDiscFolder(path, libraryOptions))
{
logger.Debug("Found multi-disc folder: " + path);
logger.LogDebug("Found multi-disc folder: " + path);
discSubfolderCount++;
}
else

View File

@@ -2,7 +2,7 @@
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.IO;
using System.Linq;

View File

@@ -7,7 +7,7 @@ using System.IO;
using System.Linq;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Resolvers
{

View File

@@ -14,7 +14,7 @@ using System.Linq;
using MediaBrowser.Controller.Drawing;
using MediaBrowser.Controller.IO;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Resolvers.Movies
{

View File

@@ -5,7 +5,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Globalization;
using Emby.Naming.Common;
using Emby.Naming.TV;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Resolvers.TV
{
@@ -72,7 +72,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
{
if (episodeInfo.EpisodeNumber.HasValue && episodeInfo.SeasonNumber.HasValue)
{
_logger.Debug("Found folder underneath series with episode number: {0}. Season {1}. Episode {2}",
_logger.LogDebug("Found folder underneath series with episode number: {0}. Season {1}. Episode {2}",
path,
episodeInfo.SeasonNumber.Value,
episodeInfo.EpisodeNumber.Value);

View File

@@ -3,7 +3,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using Emby.Naming.Common;
using Emby.Naming.TV;
using System;
@@ -131,14 +131,14 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
{
//if ((attributes & FileAttributes.Hidden) == FileAttributes.Hidden)
//{
// //logger.Debug("Igoring series file or folder marked hidden: {0}", child.FullName);
// //logger.LogDebug("Igoring series file or folder marked hidden: {0}", child.FullName);
// continue;
//}
// Can't enforce this because files saved by Bitcasa are always marked System
//if ((attributes & FileAttributes.System) == FileAttributes.System)
//{
// logger.Debug("Igoring series subfolder marked system: {0}", child.FullName);
// logger.LogDebug("Igoring series subfolder marked system: {0}", child.FullName);
// continue;
//}
@@ -146,7 +146,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
{
if (IsSeasonFolder(child.FullName, isTvContentType, libraryManager))
{
//logger.Debug("{0} is a series because of season folder {1}.", path, child.FullName);
//logger.LogDebug("{0} is a series because of season folder {1}.", path, child.FullName);
return true;
}
}
@@ -181,7 +181,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
}
}
//logger.Debug("{0} is not a series folder.", path);
//logger.LogDebug("{0} is not a series folder.", path);
return false;
}

View File

@@ -1,7 +1,7 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Search;
using System;
@@ -23,12 +23,12 @@ namespace Emby.Server.Implementations.Library
private readonly IUserManager _userManager;
private readonly ILogger _logger;
public SearchEngine(ILogManager logManager, ILibraryManager libraryManager, IUserManager userManager)
public SearchEngine(ILoggerFactory loggerFactory, ILibraryManager libraryManager, IUserManager userManager)
{
_libraryManager = libraryManager;
_userManager = userManager;
_logger = logManager.GetLogger("SearchEngine");
_logger = loggerFactory.CreateLogger("SearchEngine");
}
public QueryResult<SearchHintInfo> GetSearchHints(SearchQuery query)

View File

@@ -6,7 +6,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -32,10 +32,10 @@ namespace Emby.Server.Implementations.Library
private Func<IUserManager> _userManager;
public UserDataManager(ILogManager logManager, IServerConfigurationManager config, Func<IUserManager> userManager)
public UserDataManager(ILoggerFactory loggerFactory, IServerConfigurationManager config, Func<IUserManager> userManager)
{
_config = config;
_logger = logManager.GetLogger(GetType().Name);
_logger = loggerFactory.CreateLogger(GetType().Name);
_userManager = userManager;
}

View File

@@ -15,7 +15,7 @@ using MediaBrowser.Model.Connect;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Users;
using System;
@@ -340,7 +340,7 @@ namespace Emby.Server.Implementations.Library
UpdateInvalidLoginAttemptCount(user, user.Policy.InvalidLoginAttemptCount + 1);
}
_logger.Info("Authentication request for {0} {1}.", user.Name, success ? "has succeeded" : "has been denied");
_logger.LogInformation("Authentication request for {0} {1}.", user.Name, success ? "has succeeded" : "has been denied");
return success ? user : null;
}
@@ -392,7 +392,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error authenticating with provider {0}", ex, provider.Name);
_logger.LogError("Error authenticating with provider {0}", ex, provider.Name);
return false;
}
@@ -461,7 +461,7 @@ namespace Emby.Server.Implementations.Library
if (newValue >= maxCount)
{
//_logger.Debug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue.ToString(CultureInfo.InvariantCulture));
//_logger.LogDebug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue.ToString(CultureInfo.InvariantCulture));
//user.Policy.IsDisabled = true;
//fireLockout = true;
@@ -575,7 +575,7 @@ namespace Emby.Server.Implementations.Library
catch (Exception ex)
{
// Have to use a catch-all unfortunately because some .net image methods throw plain Exceptions
_logger.ErrorException("Error generating PrimaryImageAspectRatio for {0}", ex, user.Name);
_logger.LogError("Error generating PrimaryImageAspectRatio for {0}", ex, user.Name);
}
}
@@ -599,7 +599,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error getting {0} image info for {1}", ex, image.Type, image.Path);
_logger.LogError("Error getting {0} image info for {1}", ex, image.Type, image.Path);
return null;
}
}
@@ -775,7 +775,7 @@ namespace Emby.Server.Implementations.Library
}
catch (IOException ex)
{
_logger.ErrorException("Error deleting file {0}", ex, configPath);
_logger.LogError("Error deleting file {0}", ex, configPath);
}
DeleteUserPolicy(user);
@@ -1045,7 +1045,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error reading policy file: {0}", ex, path);
_logger.LogError("Error reading policy file: {0}", ex, path);
return GetDefaultPolicy(user);
}
@@ -1109,7 +1109,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error deleting policy file", ex);
_logger.LogError("Error deleting policy file", ex);
}
}
@@ -1144,7 +1144,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.ErrorException("Error reading policy file: {0}", ex, path);
_logger.LogError("Error reading policy file: {0}", ex, path);
return new UserConfiguration();
}

View File

@@ -1,5 +1,5 @@
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Tasks;

View File

@@ -1,6 +1,6 @@
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.IO;
@@ -70,7 +70,7 @@ namespace Emby.Server.Implementations.Library.Validators
}
catch (Exception ex)
{
_logger.ErrorException("Error refreshing {0}", ex, name);
_logger.LogError("Error refreshing {0}", ex, name);
}
numComplete++;
@@ -95,7 +95,7 @@ namespace Emby.Server.Implementations.Library.Validators
continue;
}
_logger.Info("Deleting dead {2} {0} {1}.", item.Id.ToString("N"), item.Name, item.GetType().Name);
_logger.LogInformation("Deleting dead {2} {0} {1}.", item.Id.ToString("N"), item.Name, item.GetType().Name);
_libraryManager.DeleteItem(item, new DeleteOptions
{

View File

@@ -1,5 +1,5 @@
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Tasks;

View File

@@ -1,6 +1,6 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
using System.Threading;
@@ -57,7 +57,7 @@ namespace Emby.Server.Implementations.Library.Validators
}
catch (Exception ex)
{
_logger.ErrorException("Error refreshing {0}", ex, name);
_logger.LogError("Error refreshing {0}", ex, name);
}
numComplete++;

View File

@@ -3,7 +3,7 @@ using System;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library.Validators
{

View File

@@ -1,7 +1,7 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
using System.Threading;
@@ -58,7 +58,7 @@ namespace Emby.Server.Implementations.Library.Validators
}
catch (Exception ex)
{
_logger.ErrorException("Error refreshing {0}", ex, name);
_logger.LogError("Error refreshing {0}", ex, name);
}
numComplete++;

View File

@@ -1,5 +1,5 @@
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Tasks;

View File

@@ -1,6 +1,6 @@
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
using System.Threading;
@@ -58,7 +58,7 @@ namespace Emby.Server.Implementations.Library.Validators
}
catch (Exception ex)
{
_logger.ErrorException("Error refreshing {0}", ex, name);
_logger.LogError("Error refreshing {0}", ex, name);
}
numComplete++;

View File

@@ -2,7 +2,7 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Tasks;
@@ -54,7 +54,7 @@ namespace Emby.Server.Implementations.Library.Validators
var numPeople = people.Count;
_logger.Debug("Will refresh {0} people", numPeople);
_logger.LogDebug("Will refresh {0} people", numPeople);
foreach (var person in people)
{
@@ -78,7 +78,7 @@ namespace Emby.Server.Implementations.Library.Validators
}
catch (Exception ex)
{
_logger.ErrorException("Error validating IBN entry {0}", ex, person);
_logger.LogError("Error validating IBN entry {0}", ex, person);
}
// Update progress
@@ -98,7 +98,7 @@ namespace Emby.Server.Implementations.Library.Validators
foreach (var item in deadEntities)
{
_logger.Info("Deleting dead {2} {0} {1}.", item.Id.ToString("N"), item.Name, item.GetType().Name);
_logger.LogInformation("Deleting dead {2} {0} {1}.", item.Id.ToString("N"), item.Name, item.GetType().Name);
_libraryManager.DeleteItem(item, new DeleteOptions
{
@@ -108,7 +108,7 @@ namespace Emby.Server.Implementations.Library.Validators
progress.Report(100);
_logger.Info("People validation complete");
_logger.LogInformation("People validation complete");
}
}
}

View File

@@ -1,5 +1,5 @@
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Tasks;

View File

@@ -1,5 +1,5 @@
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Logging;
using Microsoft.Extensions.Logging;
using System;
using System.Linq;
using System.Threading;
@@ -57,7 +57,7 @@ namespace Emby.Server.Implementations.Library.Validators
}
catch (Exception ex)
{
_logger.ErrorException("Error refreshing {0}", ex, name);
_logger.LogError("Error refreshing {0}", ex, name);
}
numComplete++;
@@ -77,7 +77,7 @@ namespace Emby.Server.Implementations.Library.Validators
foreach (var item in deadEntities)
{
_logger.Info("Deleting dead {2} {0} {1}.", item.Id.ToString("N"), item.Name, item.GetType().Name);
_logger.LogInformation("Deleting dead {2} {0} {1}.", item.Id.ToString("N"), item.Name, item.GetType().Name);
_libraryManager.DeleteItem(item, new DeleteOptions
{