From 86c74b3ee08338fd42c67ad7a609d324ddf3db80 Mon Sep 17 00:00:00 2001 From: Taloth Saldono Date: Mon, 21 Jan 2019 22:28:45 +0100 Subject: [PATCH] Fixed failing ConfigFileProvider tests due to ConsoleLogLevel property error. --- src/NzbDrone.Core/Configuration/ConfigFileProvider.cs | 2 +- src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs index 45972765c..599db635a 100644 --- a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs +++ b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs @@ -180,7 +180,7 @@ namespace NzbDrone.Core.Configuration public string Branch => GetValue("Branch", "master").ToLowerInvariant(); public string LogLevel => GetValue("LogLevel", "Info"); - public string ConsoleLogLevel => GetValue("ConsoleLogLevel", null, persist: false); + public string ConsoleLogLevel => GetValue("ConsoleLogLevel", string.Empty, persist: false); public string SslCertHash => GetValue("SslCertHash", ""); diff --git a/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs b/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs index f5e60fdbb..9c99dfb02 100644 --- a/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs +++ b/src/NzbDrone.Core/Instrumentation/ReconfigureLogging.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using NLog; using NLog.Config; +using NzbDrone.Common.Extensions; using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration.Events; using NzbDrone.Core.Messaging.Events; @@ -22,7 +23,7 @@ namespace NzbDrone.Core.Instrumentation var minimumLogLevel = LogLevel.FromString(_configFileProvider.LogLevel); LogLevel minimumConsoleLogLevel; - if (_configFileProvider.ConsoleLogLevel != null) + if (_configFileProvider.ConsoleLogLevel.IsNotNullOrWhiteSpace()) minimumConsoleLogLevel = LogLevel.FromString(_configFileProvider.ConsoleLogLevel); else if (minimumLogLevel > LogLevel.Info) minimumConsoleLogLevel = minimumLogLevel;