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

@@ -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();
}