mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
Log level halfway there
This commit is contained in:
parent
f162c5848f
commit
84af2be14a
7 changed files with 87 additions and 3 deletions
|
@ -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));
|
||||
|
|
|
@ -5,6 +5,7 @@ using NLog;
|
|||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.Download.Clients.Nzbget;
|
||||
using NzbDrone.Core.Download.Clients.Sabnzbd;
|
||||
using NzbDrone.Core.Instrumentation;
|
||||
|
||||
namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
|
|
12
NzbDrone.Core/Configuration/Events/ConfigFileSavedEvent.cs
Normal file
12
NzbDrone.Core/Configuration/Events/ConfigFileSavedEvent.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using NzbDrone.Common.Messaging;
|
||||
|
||||
namespace NzbDrone.Core.Configuration.Events
|
||||
{
|
||||
public class ConfigFileSavedEvent : IEvent
|
||||
{
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.Download.Clients.Nzbget;
|
||||
using NzbDrone.Core.Download.Clients.Sabnzbd;
|
||||
using NzbDrone.Core.Instrumentation;
|
||||
|
||||
namespace NzbDrone.Core.Configuration
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue