Additional Logging updates

This commit is contained in:
Brett Hewitson 2021-12-20 14:32:17 +10:00
parent d44b9319fc
commit 392d276cde
6 changed files with 74 additions and 10 deletions

View file

@ -142,6 +142,7 @@ namespace ServerManagerTool.Lib
if (process != null)
{
_serverRunning = true;
LogProfileMessage("");
LogProfileMessage($"Server process found PID {process.Id}.");
}
@ -244,6 +245,7 @@ namespace ServerManagerTool.Lib
LogProfileMessage($"Server Manager version: {App.Instance.Version}");
// stop the server
LogProfileMessage("");
StopServer(cancellationToken);
if (ExitCode != EXITCODE_NORMALEXIT)
@ -273,6 +275,7 @@ namespace ServerManagerTool.Lib
{
try
{
LogProfileMessage("");
ServerStatusChangeCallback?.Invoke(ServerStatus.Updating);
UpgradeLocal(true, true, steamCmdRemoveQuit, cancellationToken);
}
@ -288,6 +291,7 @@ namespace ServerManagerTool.Lib
// check if this is a shutdown only, or a shutdown and restart.
if (restartServer)
{
LogProfileMessage("");
StartServer();
if (ExitCode != EXITCODE_NORMALEXIT)
@ -1208,7 +1212,6 @@ namespace ServerManagerTool.Lib
emailMessage.AppendLine($"Server Manager version: {App.Instance.Version}");
// make a backup of the current profile and config files.
LogProfileMessage("");
CreateProfileBackupArchiveFile(_profile);
if (ExitCode != EXITCODE_NORMALEXIT)
@ -1217,7 +1220,6 @@ namespace ServerManagerTool.Lib
if (BackupWorldFile)
{
// make a backup of the current world file.
LogProfileMessage("");
CreateServerBackupArchiveFile(emailMessage, _profile);
if (ExitCode != EXITCODE_NORMALEXIT)
@ -1854,6 +1856,7 @@ namespace ServerManagerTool.Lib
// create the backup file.
try
{
LogProfileMessage("");
LogProfileMessage("Back up profile and config files started...");
var backupFolder = GetProfileBackupFolder(_profile);
@ -1916,6 +1919,7 @@ namespace ServerManagerTool.Lib
{
var deleteInterval = Config.Default.AutoBackup_EnableBackup ? Config.Default.AutoBackup_DeleteInterval : BACKUP_DELETEINTERVAL;
LogProfileMessage("");
LogProfileMessage("Delete old profile backup files started...");
var backupFolder = GetProfileBackupFolder(_profile);
@ -1985,6 +1989,8 @@ namespace ServerManagerTool.Lib
{
_profile = profile;
LogProfileMessage("");
// check if the servers save folder exists
var saveFolder = GetServerSaveFolder();
if (Directory.Exists(saveFolder))
@ -2109,6 +2115,7 @@ namespace ServerManagerTool.Lib
{
var deleteInterval = Config.Default.AutoBackup_EnableBackup ? Config.Default.AutoBackup_DeleteInterval : BACKUP_DELETEINTERVAL;
LogProfileMessage("");
LogProfileMessage("Delete old server backup files started...");
var backupFolder = GetServerBackupFolder(_profile);
@ -2809,6 +2816,7 @@ namespace ServerManagerTool.Lib
}
}
LogProfileMessage("");
LogProfileMessage($"Exitcode = {ExitCode}");
return ExitCode;
}
@ -2905,6 +2913,7 @@ namespace ServerManagerTool.Lib
}
}
LogProfileMessage("");
LogProfileMessage($"Exitcode = {ExitCode}");
return ExitCode;
}

View file

@ -9,8 +9,8 @@
<entry>
<id>urn:uuid:3E33DCB2-ECFE-4489-B1A4-56F5D386F9DC</id>
<title>1.1.413 (1.1.413.14)</title>
<summary>1.1.413.14</summary>
<title>1.1.413 (1.1.413.15)</title>
<summary>1.1.413.15</summary>
<link href="" />
<updated>2021-12-20T00:00:00Z</updated>
<content type="xhtml">

View file

@ -8,7 +8,30 @@
<updated>2021-12-20T00:00:00Z</updated>
<entry>
<id>urn:uuid:84796ACA-B3A1-4EEA-962A-1FB59E0ACFB3</id>
<id>urn:uuid:6E0126E3-4120-4F3A-9EF1-05762C2A5078</id>
<title>1.1.413 (1.1.413.15)</title>
<summary>1.1.413.15</summary>
<link href="" />
<updated>2021-12-20T00:00:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
<p>
<u style="font-size: .9em;">CHANGE</u>
<br/>
<ul>
<li>Auto process - tweaked logging.</li>
</ul>
</p>
</div>
</content>
<author>
<name>bletch</name>
<email>bletch1971@hotmail.com</email>
</author>
</entry>
<entry>
<id>urn:uuid:2CEA3E4F-C188-4AF2-B56D-FD17BAC5FC1C</id>
<title>1.1.413 (1.1.413.14)</title>
<summary>1.1.413.14</summary>
<link href="" />

View file

@ -143,6 +143,7 @@ namespace ServerManagerTool.Lib
if (process != null)
{
_serverRunning = true;
LogProfileMessage("");
LogProfileMessage($"Server process found PID {process.Id}.");
}
@ -245,6 +246,7 @@ namespace ServerManagerTool.Lib
LogProfileMessage($"Server Manager version: {App.Instance.Version}");
// stop the server
LogProfileMessage("");
StopServer(cancellationToken);
if (ExitCode != EXITCODE_NORMALEXIT)
@ -274,6 +276,7 @@ namespace ServerManagerTool.Lib
{
try
{
LogProfileMessage("");
ServerStatusChangeCallback?.Invoke(ServerStatus.Updating);
UpgradeLocal(true, true, steamCmdRemoveQuit, cancellationToken);
}
@ -289,6 +292,7 @@ namespace ServerManagerTool.Lib
// check if this is a shutdown only, or a shutdown and restart.
if (restartServer)
{
LogProfileMessage("");
StartServer();
if (ExitCode != EXITCODE_NORMALEXIT)
@ -1166,7 +1170,6 @@ namespace ServerManagerTool.Lib
emailMessage.AppendLine($"Server Manager version: {App.Instance.Version}");
// make a backup of the current profile and config files.
LogProfileMessage("");
CreateProfileBackupArchiveFile(_profile);
if (ExitCode != EXITCODE_NORMALEXIT)
@ -1175,7 +1178,6 @@ namespace ServerManagerTool.Lib
if (BackupWorldFile)
{
// make a backup of the current world file.
LogProfileMessage("");
CreateServerBackupArchiveFile(emailMessage, _profile);
if (ExitCode != EXITCODE_NORMALEXIT)
@ -1776,6 +1778,7 @@ namespace ServerManagerTool.Lib
// create the backup file.
try
{
LogProfileMessage("");
LogProfileMessage("Back up profile and config files started...");
var backupFolder = GetProfileBackupFolder(_profile);
@ -1840,6 +1843,7 @@ namespace ServerManagerTool.Lib
{
var deleteInterval = Config.Default.AutoBackup_EnableBackup ? Config.Default.AutoBackup_DeleteInterval : BACKUP_DELETEINTERVAL;
LogProfileMessage("");
LogProfileMessage("Delete old profile backup files started...");
var backupFolder = GetProfileBackupFolder(_profile);
@ -1909,6 +1913,8 @@ namespace ServerManagerTool.Lib
{
_profile = profile;
LogProfileMessage("");
// check if the servers save folder exists
var saveFolder = GetServerSaveFolder();
if (Directory.Exists(saveFolder))
@ -2006,6 +2012,7 @@ namespace ServerManagerTool.Lib
{
var deleteInterval = Config.Default.AutoBackup_EnableBackup ? Config.Default.AutoBackup_DeleteInterval : BACKUP_DELETEINTERVAL;
LogProfileMessage("");
LogProfileMessage("Delete old server backup files started...");
var backupFolder = GetServerBackupFolder(_profile);
@ -2702,6 +2709,7 @@ namespace ServerManagerTool.Lib
}
}
LogProfileMessage("");
LogProfileMessage($"Exitcode = {ExitCode}");
return ExitCode;
}
@ -2798,6 +2806,7 @@ namespace ServerManagerTool.Lib
}
}
LogProfileMessage("");
LogProfileMessage($"Exitcode = {ExitCode}");
return ExitCode;
}

View file

@ -9,8 +9,8 @@
<entry>
<id>urn:uuid:19B09A66-43F2-4D5F-AF33-5C77D7EA9A6B</id>
<title>1.1.58 (1.1.58.14)</title>
<summary>1.1.58.14</summary>
<title>1.1.58 (1.1.58.15)</title>
<summary>1.1.58.15</summary>
<link href="" />
<updated>2021-12-20T00:00:00Z</updated>
<content type="xhtml">

View file

@ -8,7 +8,30 @@
<updated>2021-12-20T00:00:00Z</updated>
<entry>
<id>urn:uuid:2F47A36B-221D-4B74-882E-C990226A441B</id>
<id>urn:uuid:5FA48BA6-9154-4626-9B33-63F2D9079B2D</id>
<title>1.1.58 (1.1.58.15)</title>
<summary>1.1.58.15</summary>
<link href="" />
<updated>2021-12-20T00:00:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
<p>
<u style="font-size: .9em;">CHANGE</u>
<br/>
<ul>
<li>Auto process - tweaked logging.</li>
</ul>
</p>
</div>
</content>
<author>
<name>bletch</name>
<email>bletch1971@hotmail.com</email>
</author>
</entry>
<entry>
<id>urn:uuid:B6CDDC20-AD16-4338-8F33-CF12D6A62713</id>
<title>1.1.58 (1.1.58.14)</title>
<summary>1.1.58.14</summary>
<link href="" />