SEBWIN-835: Removed debugging logs for power supply thresholds.
This commit is contained in:
parent
23de2bf8c7
commit
73fefad434
4 changed files with 0 additions and 21 deletions
|
@ -45,8 +45,6 @@ namespace SafeExamBrowser.Client.Operations
|
||||||
logger.Info($" -> Runtime-ID: {Context.AppConfig.RuntimeId}");
|
logger.Info($" -> Runtime-ID: {Context.AppConfig.RuntimeId}");
|
||||||
logger.Info($" -> Session-ID: {Context.SessionId}");
|
logger.Info($" -> Session-ID: {Context.SessionId}");
|
||||||
|
|
||||||
logger.Warn($"Power Supply Thresholds: Low = {configuration.Settings.PowerSupply.ChargeThresholdLow}, Critical = {configuration.Settings.PowerSupply.ChargeThresholdCritical}.");
|
|
||||||
|
|
||||||
return OperationResult.Success;
|
return OperationResult.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,11 +122,8 @@ namespace SafeExamBrowser.Configuration
|
||||||
var status = default(LoadStatus);
|
var status = default(LoadStatus);
|
||||||
|
|
||||||
settings = LoadDefaultSettings();
|
settings = LoadDefaultSettings();
|
||||||
|
|
||||||
logger.Info($"Initialized default settings, now attempting to load '{resource}'...");
|
logger.Info($"Initialized default settings, now attempting to load '{resource}'...");
|
||||||
|
|
||||||
logger.Warn($"Power Supply Thresholds: Low = {settings.PowerSupply.ChargeThresholdLow}, Critical = {settings.PowerSupply.ChargeThresholdCritical}.");
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
status = TryLoadData(resource, out var stream);
|
status = TryLoadData(resource, out var stream);
|
||||||
|
@ -137,11 +134,6 @@ namespace SafeExamBrowser.Configuration
|
||||||
{
|
{
|
||||||
status = TryParseData(stream, out _, out _, out var data, password);
|
status = TryParseData(stream, out _, out _, out var data, password);
|
||||||
|
|
||||||
data.TryGetValue(Keys.UserInterface.SystemControls.PowerSupply.ChargeThresholdCritical, out var critical);
|
|
||||||
data.TryGetValue(Keys.UserInterface.SystemControls.PowerSupply.ChargeThresholdLow, out var low);
|
|
||||||
|
|
||||||
logger.Warn($"Power Supply Thresholds: Low (raw) = {low}, Critical (raw) = {critical}.");
|
|
||||||
|
|
||||||
if (status == LoadStatus.Success)
|
if (status == LoadStatus.Success)
|
||||||
{
|
{
|
||||||
dataMapper.MapRawDataToSettings(data, settings);
|
dataMapper.MapRawDataToSettings(data, settings);
|
||||||
|
@ -156,8 +148,6 @@ namespace SafeExamBrowser.Configuration
|
||||||
logger.Error($"Unexpected error while trying to load '{resource}'!", e);
|
logger.Error($"Unexpected error while trying to load '{resource}'!", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Warn($"Power Supply Thresholds: Low = {settings.PowerSupply.ChargeThresholdLow}, Critical = {settings.PowerSupply.ChargeThresholdCritical}.");
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -260,10 +260,7 @@ namespace SafeExamBrowser.Configuration.DataFormats
|
||||||
value = Convert.ToInt32(element.Value);
|
value = Convert.ToInt32(element.Value);
|
||||||
break;
|
break;
|
||||||
case XmlElement.Real:
|
case XmlElement.Real:
|
||||||
logger.Warn($"Power Supply Threshold: Raw XML = {element}.");
|
|
||||||
logger.Warn($"Power Supply Threshold: Raw XML value = {element.Value}.");
|
|
||||||
value = Convert.ToDouble(element.Value, CultureInfo.InvariantCulture);
|
value = Convert.ToDouble(element.Value, CultureInfo.InvariantCulture);
|
||||||
logger.Warn($"Power Supply Threshold: Parsed double value = {value}.");
|
|
||||||
break;
|
break;
|
||||||
case XmlElement.String:
|
case XmlElement.String:
|
||||||
value = element.IsEmpty ? null : element.Value;
|
value = element.IsEmpty ? null : element.Value;
|
||||||
|
|
|
@ -53,8 +53,6 @@ namespace SafeExamBrowser.SystemComponents.PowerSupply
|
||||||
lastStatusLog = DateTime.Now;
|
lastStatusLog = DateTime.Now;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Warn($"Raw Charge: {charge}, Low Threshold: {low}, Critical Threshold: {critical}, Status: {status.BatteryChargeStatus}");
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,13 +60,9 @@ namespace SafeExamBrowser.SystemComponents.PowerSupply
|
||||||
{
|
{
|
||||||
const int TWO_SECONDS = 2000;
|
const int TWO_SECONDS = 2000;
|
||||||
|
|
||||||
logger.Warn($"Pre-Sanitized Low Threshold: {settings.ChargeThresholdLow}, Pre-Sanitized Critical Threshold: {settings.ChargeThresholdCritical}");
|
|
||||||
|
|
||||||
critical = SanitizeThreshold(settings.ChargeThresholdCritical);
|
critical = SanitizeThreshold(settings.ChargeThresholdCritical);
|
||||||
low = SanitizeThreshold(settings.ChargeThresholdLow);
|
low = SanitizeThreshold(settings.ChargeThresholdLow);
|
||||||
|
|
||||||
logger.Warn($"Sanitized Low Threshold: {low}, Sanitized Critical Threshold: {critical}");
|
|
||||||
|
|
||||||
timer = new Timer(TWO_SECONDS);
|
timer = new Timer(TWO_SECONDS);
|
||||||
timer.Elapsed += Timer_Elapsed;
|
timer.Elapsed += Timer_Elapsed;
|
||||||
timer.AutoReset = true;
|
timer.AutoReset = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue