Skip to content
Snippets Groups Projects
Commit 5353ea07 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Make StartupSummary() print one message instead of many small ones.

parent 9c75a68b
No related branches found
No related tags found
No related merge requests found
...@@ -190,7 +190,7 @@ namespace AutoTx ...@@ -190,7 +190,7 @@ namespace AutoTx
/// Write a summary of loaded config + status to the log. /// Write a summary of loaded config + status to the log.
/// </summary> /// </summary>
private void StartupSummary() { private void StartupSummary() {
var msg = "\n\n------ RoboSharp ------\n"; var msg = "Startup Summary:\n\n------ RoboSharp ------\n";
var roboDll = System.Reflection.Assembly.GetAssembly(typeof(RoboCommand)).Location; var roboDll = System.Reflection.Assembly.GetAssembly(typeof(RoboCommand)).Location;
if (roboDll != null) { if (roboDll != null) {
var versionInfo = FileVersionInfo.GetVersionInfo(roboDll); var versionInfo = FileVersionInfo.GetVersionInfo(roboDll);
...@@ -198,27 +198,24 @@ namespace AutoTx ...@@ -198,27 +198,24 @@ namespace AutoTx
" > DLL description: " + versionInfo.Comments + "\n" + " > DLL description: " + versionInfo.Comments + "\n" +
" > DLL version: " + versionInfo.FileVersion + "\n"; " > DLL version: " + versionInfo.FileVersion + "\n";
} }
writeLogDebug(msg);
msg = "\n\n------ Loaded status flags ------\n" + _status.Summary() + msg += "\n------ Loaded status flags ------\n" + _status.Summary() +
"\n------ Loaded configuration settings ------\n" + _config.Summary(); "\n------ Loaded configuration settings ------\n" + _config.Summary();
writeLogDebug(msg);
msg = "\n\n------ Current system parameters ------\n" + msg += "\n------ Current system parameters ------\n" +
"Hostname: " + Environment.MachineName + "\n" + "Hostname: " + Environment.MachineName + "\n" +
"Free system memory: " + GetFreeMemory() + " MB" + "\n"; "Free system memory: " + GetFreeMemory() + " MB" + "\n";
foreach (var driveToCheck in _config.SpaceMonitoring) { foreach (var driveToCheck in _config.SpaceMonitoring) {
msg += "Free space on drive '" + driveToCheck.DriveName + "': " + msg += "Free space on drive '" + driveToCheck.DriveName + "': " +
GetFreeDriveSpace(driveToCheck.DriveName) + "\n"; GetFreeDriveSpace(driveToCheck.DriveName) + "\n";
} }
writeLogDebug(msg);
writeLogDebug("------ Grace location status ------"); msg += "\n------ Grace location status ------\n";
try { try {
CheckGraceLocation(); msg += GraceLocationSummary();
} }
catch (Exception ex) { catch (Exception ex) {
writeLog("CheckGraceLocation() failed: " + ex.Message, true); writeLog("CheckGraceLocation() failed: " + ex.Message, true);
...@@ -232,6 +229,7 @@ namespace AutoTx ...@@ -232,6 +229,7 @@ namespace AutoTx
writeLog("WARNING: some status parameters were invalid and have been reset:\n" + writeLog("WARNING: some status parameters were invalid and have been reset:\n" +
_status.ValidationWarnings); _status.ValidationWarnings);
} }
writeLogDebug(msg);
} }
#endregion #endregion
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment