Skip to content

Commit e49cc32

Browse files
committed
Additional AppUpdater log covering
1 parent 37546a0 commit e49cc32

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

AppUpdater/Log.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ public static void Write(int logLevel, bool forceConsole, string logMessage)
125125

126126
public static void Write(int logLevel, string logMessage)
127127
{
128-
#if DEBUG
129-
LogFallbackInternal(logMessage);
130-
#endif
131-
132128
if (!m_bInit)
133129
{
134130
// If not initialized - something was probably wrong with creating a log directory.

AppUpdater/MUVersion.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ public static bool Init()
5454
public static Version GetRemoteData()
5555
{
5656
//string versionStr = latestRelease.TagName.Substring(1); // Remove "v"
57-
string versionStr = latestRelease.TagName; // Don't need to remove "v" anymore
57+
string versionStr = latestRelease.TagName; // Doesn't need to remove "v" anymore
5858

5959
Version remoteVersion = new Version(versionStr);
6060
//remoteVersion = new Version("11.01.025");
6161

62+
Log.Write(LogLevel.BASIC, true, "Remote MedocUpdates version is " + remoteVersion);
63+
6264
return remoteVersion;
6365
}
6466

AppUpdater/Program.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class Program
1616
static void Main(string[] args)
1717
{
1818
Log.Init();
19+
Log.Write("");
20+
Log.Write("AppUpdater: Start");
1921

2022
// Check if the program is running right now
2123
Process[] mainAppProcesses = Process.GetProcessesByName("MedocUpdates");
@@ -109,7 +111,7 @@ static void Main(string[] args)
109111
switch (remoteVersion.CompareTo(localVersion))
110112
{
111113
case 0:
112-
Console.WriteLine("Versions are equal");
114+
Log.Write(LogLevel.BASIC, true, "Versions are equal");
113115

114116
string forceRestart = args.FirstOrDefault(elem => elem.Equals("-forcerestart"));
115117
if (forceRestart != null && forceRestart.Trim().Length > 0)
@@ -120,7 +122,7 @@ static void Main(string[] args)
120122

121123
break;
122124
case 1:
123-
Console.WriteLine("Online version is newer");
125+
Log.Write(LogLevel.BASIC, true, "Online version is newer");
124126

125127
if(MUVersion.LatestRelease == null)
126128
{
@@ -151,7 +153,7 @@ static void Main(string[] args)
151153

152154
break;
153155
case -1:
154-
Console.WriteLine("Local version is newer");
156+
Log.Write(LogLevel.BASIC, true, "Local version is newer");
155157
break;
156158
default:
157159
Log.Write(LogLevel.NORMAL,
@@ -160,7 +162,7 @@ static void Main(string[] args)
160162
break;
161163
}
162164

163-
Console.WriteLine("\r\nMedocUpdates is updated.");
165+
Log.Write(LogLevel.BASIC, true, "\r\nMedocUpdates has been updated.");
164166
Console.ReadLine();
165167
}
166168
}

0 commit comments

Comments
 (0)