From ceba0e8a2fdacc7c50bbf21976b4f0b8c626dade Mon Sep 17 00:00:00 2001 From: dbuechel Date: Tue, 10 Sep 2019 11:57:15 +0200 Subject: [PATCH] Only log remaining battery time if not connected to the grid. --- SafeExamBrowser.SystemComponents/PowerSupply/PowerSupply.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SafeExamBrowser.SystemComponents/PowerSupply/PowerSupply.cs b/SafeExamBrowser.SystemComponents/PowerSupply/PowerSupply.cs index 4ee8c641..39f90a2d 100644 --- a/SafeExamBrowser.SystemComponents/PowerSupply/PowerSupply.cs +++ b/SafeExamBrowser.SystemComponents/PowerSupply/PowerSupply.cs @@ -43,7 +43,7 @@ namespace SafeExamBrowser.SystemComponents.PowerSupply if (lastStatusLog < DateTime.Now.AddMinutes(-1)) { - logger.Debug($"Power grid is {(status.IsOnline ? "" : "not ")}connected, battery charge at {charge * 100}% ({status.BatteryTimeRemaining})."); + logger.Debug($"Power grid is {(status.IsOnline ? "" : "not ")}connected, battery charge at {charge * 100}%{(status.IsOnline ? "" : $" ({status.BatteryTimeRemaining})")}."); lastStatusLog = DateTime.Now; }