From b7fab7db0cd2005d37ee93429493ca34629f3b35 Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 29 Oct 2017 17:46:54 -0400 Subject: [PATCH] Log when running tray app --- src/NzbDrone.Common/EnvironmentInfo/IRuntimeInfo.cs | 1 + src/NzbDrone.Host/Router.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Common/EnvironmentInfo/IRuntimeInfo.cs b/src/NzbDrone.Common/EnvironmentInfo/IRuntimeInfo.cs index e518455ef..a8e4bd9ad 100644 --- a/src/NzbDrone.Common/EnvironmentInfo/IRuntimeInfo.cs +++ b/src/NzbDrone.Common/EnvironmentInfo/IRuntimeInfo.cs @@ -8,6 +8,7 @@ namespace NzbDrone.Common.EnvironmentInfo bool IsUserInteractive { get; } bool IsAdmin { get; } bool IsWindowsService { get; } + bool IsWindowsTray { get; } bool IsExiting { get; set; } bool IsTray { get; } RuntimeMode Mode { get; } diff --git a/src/NzbDrone.Host/Router.cs b/src/NzbDrone.Host/Router.cs index 48e72f873..f6f5f7a4d 100644 --- a/src/NzbDrone.Host/Router.cs +++ b/src/NzbDrone.Host/Router.cs @@ -13,18 +13,21 @@ namespace NzbDrone.Host private readonly INzbDroneServiceFactory _nzbDroneServiceFactory; private readonly IServiceProvider _serviceProvider; private readonly IConsoleService _consoleService; + private readonly IRuntimeInfo _runtimeInfo; private readonly IProcessProvider _processProvider; private readonly Logger _logger; public Router(INzbDroneServiceFactory nzbDroneServiceFactory, IServiceProvider serviceProvider, IConsoleService consoleService, + IRuntimeInfo runtimeInfo, IProcessProvider processProvider, Logger logger) { _nzbDroneServiceFactory = nzbDroneServiceFactory; _serviceProvider = serviceProvider; _consoleService = consoleService; + _runtimeInfo = runtimeInfo; _processProvider = processProvider; _logger = logger; } @@ -44,7 +47,7 @@ namespace NzbDrone.Host case ApplicationModes.Interactive: { - _logger.Debug("Console selected"); + _logger.Debug(_runtimeInfo.IsWindowsTray ? "Tray selected" : "Console selected"); _nzbDroneServiceFactory.Start(); break; }