aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2019-01-07 00:47:06 -0500
committerGitHub <noreply@github.com>2019-01-07 00:47:06 -0500
commitc986340c02cb0b7fe06569d25a1b5d1c8375f7f6 (patch)
tree4971c970bbdb797cc5b3da2d8bae506231b173a5 /Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
parent76b647e0a8eddd65dc9c4de7b887a3faf6e12bcc (diff)
parent0b804629b85498370c882f5562dfc7acd84bfd11 (diff)
Merge pull request #419 from jellyfin/dev
Master 10.0.0
Diffstat (limited to 'Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs')
-rw-r--r--Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs22
1 files changed, 10 insertions, 12 deletions
diff --git a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
index 385b4bd51..bc5168fe8 100644
--- a/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
+++ b/Emby.Server.Implementations/AppBase/BaseConfigurationManager.cs
@@ -9,7 +9,7 @@ using MediaBrowser.Common.Events;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.IO;
-using MediaBrowser.Model.Logging;
+using Microsoft.Extensions.Logging;
using MediaBrowser.Model.Serialization;
namespace Emby.Server.Implementations.AppBase
@@ -97,14 +97,14 @@ namespace Emby.Server.Implementations.AppBase
/// Initializes a new instance of the <see cref="BaseConfigurationManager" /> class.
/// </summary>
/// <param name="applicationPaths">The application paths.</param>
- /// <param name="logManager">The log manager.</param>
+ /// <param name="loggerFactory">The logger factory.</param>
/// <param name="xmlSerializer">The XML serializer.</param>
- protected BaseConfigurationManager(IApplicationPaths applicationPaths, ILogManager logManager, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
+ protected BaseConfigurationManager(IApplicationPaths applicationPaths, ILoggerFactory loggerFactory, IXmlSerializer xmlSerializer, IFileSystem fileSystem)
{
CommonApplicationPaths = applicationPaths;
XmlSerializer = xmlSerializer;
FileSystem = fileSystem;
- Logger = logManager.GetLogger(GetType().Name);
+ Logger = loggerFactory.CreateLogger(GetType().Name);
UpdateCachePath();
}
@@ -123,7 +123,7 @@ namespace Emby.Server.Implementations.AppBase
/// </summary>
public void SaveConfiguration()
{
- Logger.Info("Saving system configuration");
+ Logger.LogInformation("Saving system configuration");
var path = CommonApplicationPaths.SystemConfigurationFilePath;
FileSystem.CreateDirectory(FileSystem.GetDirectoryName(path));
@@ -259,7 +259,7 @@ namespace Emby.Server.Implementations.AppBase
}
catch (Exception ex)
{
- Logger.ErrorException("Error loading configuration file: {0}", ex, path);
+ Logger.LogError(ex, "Error loading configuration file: {path}", path);
return Activator.CreateInstance(configurationType);
}
@@ -283,12 +283,11 @@ namespace Emby.Server.Implementations.AppBase
validatingStore.Validate(currentConfiguration, configuration);
}
- EventHelper.FireEventIfNotNull(NamedConfigurationUpdating, this, new ConfigurationUpdateEventArgs
+ NamedConfigurationUpdating?.Invoke( this, new ConfigurationUpdateEventArgs
{
Key = key,
NewConfiguration = configuration
-
- }, Logger);
+ });
_configurations.AddOrUpdate(key, configuration, (k, v) => configuration);
@@ -305,12 +304,11 @@ namespace Emby.Server.Implementations.AppBase
protected virtual void OnNamedConfigurationUpdated(string key, object configuration)
{
- EventHelper.FireEventIfNotNull(NamedConfigurationUpdated, this, new ConfigurationUpdateEventArgs
+ NamedConfigurationUpdated?.Invoke(this, new ConfigurationUpdateEventArgs
{
Key = key,
NewConfiguration = configuration
-
- }, Logger);
+ });
}
public Type GetConfigurationType(string key)