From 5353ea076b965f7e5c3156c78cb50306a5d696d3 Mon Sep 17 00:00:00 2001
From: Niko Ehrenfeuchter <nikolaus.ehrenfeuchter@unibas.ch>
Date: Wed, 20 Dec 2017 16:39:39 +0100
Subject: [PATCH] Make StartupSummary() print one message instead of many small
 ones.

---
 AutoTx/AutoTx.cs | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/AutoTx/AutoTx.cs b/AutoTx/AutoTx.cs
index 1bf7190..dcebf6d 100644
--- a/AutoTx/AutoTx.cs
+++ b/AutoTx/AutoTx.cs
@@ -190,7 +190,7 @@ namespace AutoTx
         /// Write a summary of loaded config + status to the log.
         /// </summary>
         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;
             if (roboDll != null) {
                 var versionInfo = FileVersionInfo.GetVersionInfo(roboDll);
@@ -198,27 +198,24 @@ namespace AutoTx
                        " > DLL description: " + versionInfo.Comments + "\n" +
                        " > DLL version: " + versionInfo.FileVersion + "\n";
             }
-            writeLogDebug(msg);
 
 
-            msg = "\n\n------ Loaded status flags ------\n" + _status.Summary() +
-                  "\n------ Loaded configuration settings ------\n" + _config.Summary();
-            writeLogDebug(msg);
+            msg += "\n------ Loaded status flags ------\n" + _status.Summary() +
+                   "\n------ Loaded configuration settings ------\n" + _config.Summary();
 
 
-            msg = "\n\n------ Current system parameters ------\n" +
-                  "Hostname: " + Environment.MachineName + "\n" +
-                  "Free system memory: " + GetFreeMemory() + " MB" + "\n";
+            msg += "\n------ Current system parameters ------\n" +
+                   "Hostname: " + Environment.MachineName + "\n" +
+                   "Free system memory: " + GetFreeMemory() + " MB" + "\n";
             foreach (var driveToCheck in _config.SpaceMonitoring) {
                 msg += "Free space on drive '" + driveToCheck.DriveName + "': " +
                        GetFreeDriveSpace(driveToCheck.DriveName) + "\n";
             }
-            writeLogDebug(msg);
 
 
-            writeLogDebug("------ Grace location status ------");
+            msg += "\n------ Grace location status ------\n";
             try {
-                CheckGraceLocation();
+                msg += GraceLocationSummary();
             }
             catch (Exception ex) {
                 writeLog("CheckGraceLocation() failed: " + ex.Message, true);
@@ -232,6 +229,7 @@ namespace AutoTx
                 writeLog("WARNING: some status parameters were invalid and have been reset:\n" +
                          _status.ValidationWarnings);
             }
+            writeLogDebug(msg);
         }
 
         #endregion
-- 
GitLab