mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-28 21:12:43 +02:00
Log level halfway there
This commit is contained in:
@@ -6,6 +6,8 @@ using System.Xml.Linq;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Common.Cache;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using NzbDrone.Common.Messaging;
|
||||
using NzbDrone.Core.Configuration.Events;
|
||||
|
||||
namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
@@ -19,19 +21,22 @@ namespace NzbDrone.Core.Configuration
|
||||
bool AuthenticationEnabled { get; }
|
||||
string Username { get; }
|
||||
string Password { get; }
|
||||
string LogLevel { get; }
|
||||
}
|
||||
|
||||
public class ConfigFileProvider : IConfigFileProvider
|
||||
{
|
||||
private readonly IAppFolderInfo _appFolderInfo;
|
||||
private readonly IMessageAggregator _messageAggregator;
|
||||
private readonly ICached<string> _cache;
|
||||
|
||||
private readonly string _configFile;
|
||||
|
||||
public ConfigFileProvider(IAppFolderInfo appFolderInfo, ICacheManger cacheManger)
|
||||
public ConfigFileProvider(IAppFolderInfo appFolderInfo, ICacheManger cacheManger, IMessageAggregator messageAggregator)
|
||||
{
|
||||
_appFolderInfo = appFolderInfo;
|
||||
_cache = cacheManger.GetCache<string>(GetType());
|
||||
_messageAggregator = messageAggregator;
|
||||
_configFile = _appFolderInfo.GetConfigPath();
|
||||
}
|
||||
|
||||
@@ -72,7 +77,7 @@ namespace NzbDrone.Core.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_messageAggregator.PublishEvent(new ConfigFileSavedEvent());
|
||||
}
|
||||
|
||||
public int Port
|
||||
@@ -100,6 +105,11 @@ namespace NzbDrone.Core.Configuration
|
||||
get { return GetValue("Password", ""); }
|
||||
}
|
||||
|
||||
public string LogLevel
|
||||
{
|
||||
get { return GetValue("LogLevel", "Info"); }
|
||||
}
|
||||
|
||||
public int GetValueInt(string key, int defaultValue)
|
||||
{
|
||||
return Convert.ToInt32(GetValue(key, defaultValue));
|
||||
|
Reference in New Issue
Block a user