mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-07 21:51:13 -07:00
fix saving the log level
This commit is contained in:
parent
5dc39b9b3a
commit
84edd6636d
6 changed files with 69 additions and 8 deletions
|
@ -68,6 +68,7 @@ namespace PlexRequests.UI.Modules
|
|||
private ISettingsService<PushbulletNotificationSettings> PushbulletService { get; }
|
||||
private ISettingsService<PushoverNotificationSettings> PushoverService { get; }
|
||||
private ISettingsService<HeadphonesSettings> HeadphonesService { get; }
|
||||
private ISettingsService<LogSettings> LogService { get; }
|
||||
private IPlexApi PlexApi { get; }
|
||||
private ISonarrApi SonarrApi { get; }
|
||||
private IPushbulletApi PushbulletApi { get; }
|
||||
|
@ -95,6 +96,7 @@ namespace PlexRequests.UI.Modules
|
|||
IRepository<LogEntity> logsRepo,
|
||||
INotificationService notify,
|
||||
ISettingsService<HeadphonesSettings> headphones,
|
||||
ISettingsService<LogSettings> logs,
|
||||
ICacheProvider cache) : base("admin")
|
||||
{
|
||||
PrService = prService;
|
||||
|
@ -114,6 +116,7 @@ namespace PlexRequests.UI.Modules
|
|||
PushoverApi = pushoverApi;
|
||||
NotificationService = notify;
|
||||
HeadphonesService = headphones;
|
||||
LogService = logs;
|
||||
Cache = cache;
|
||||
|
||||
#if !DEBUG
|
||||
|
@ -637,8 +640,16 @@ namespace PlexRequests.UI.Modules
|
|||
|
||||
private Response UpdateLogLevels(int level)
|
||||
{
|
||||
var settings = LogService.GetSettings();
|
||||
|
||||
// apply the level
|
||||
var newLevel = LogLevel.FromOrdinal(level);
|
||||
LoggingHelper.ReconfigureLogLevel(newLevel);
|
||||
|
||||
//save the log settings
|
||||
settings.Level = level;
|
||||
LogService.SaveSettings(settings);
|
||||
|
||||
return Response.AsJson(new JsonResponseModel { Result = true, Message = $"The new log level is now {newLevel}"});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue