SEBWIN-835: Added debugging logs for power supply thresholds.
This commit is contained in:
parent
cecfe095a7
commit
c52c461dbf
1 changed files with 8 additions and 2 deletions
|
@ -22,10 +22,10 @@ namespace SafeExamBrowser.SystemComponents.PowerSupply
|
|||
private readonly ILogger logger;
|
||||
private readonly PowerSupplySettings settings;
|
||||
|
||||
private DateTime lastStatusLog;
|
||||
private Timer timer;
|
||||
private double critical;
|
||||
private double low;
|
||||
private DateTime lastStatusLog;
|
||||
private Timer timer;
|
||||
|
||||
public event StatusChangedEventHandler StatusChanged;
|
||||
|
||||
|
@ -53,6 +53,8 @@ namespace SafeExamBrowser.SystemComponents.PowerSupply
|
|||
lastStatusLog = DateTime.Now;
|
||||
}
|
||||
|
||||
logger.Warn($"Raw Charge: {charge}, Low Threshold: {low}, Critical Threshold: {critical}, Status: {status.BatteryChargeStatus}");
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -60,9 +62,13 @@ namespace SafeExamBrowser.SystemComponents.PowerSupply
|
|||
{
|
||||
const int TWO_SECONDS = 2000;
|
||||
|
||||
logger.Warn($"Pre-Sanitized Low Threshold: {settings.ChargeThresholdLow}, Pre-Sanitized Critical Threshold: {settings.ChargeThresholdCritical}");
|
||||
|
||||
critical = SanitizeThreshold(settings.ChargeThresholdCritical);
|
||||
low = SanitizeThreshold(settings.ChargeThresholdLow);
|
||||
|
||||
logger.Warn($"Sanitized Low Threshold: {low}, Sanitized Critical Threshold: {critical}");
|
||||
|
||||
timer = new Timer(TWO_SECONDS);
|
||||
timer.Elapsed += Timer_Elapsed;
|
||||
timer.AutoReset = true;
|
||||
|
|
Loading…
Reference in a new issue