Skip to content

Commit bf620cf

Browse files
committed
Add debug logging to OSS upgrade process
Inserted GeneralTracer.Debug statements at key steps in the OSS upgrade workflow to improve traceability and aid in debugging.
1 parent b73d7f9 commit bf620cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/c#/GeneralUpdate.ClientCore/GeneralClientOSS.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ await Task.Run(() =>
2828
{
2929
try
3030
{
31+
GeneralTracer.Debug("1.Starting OSS upgrade mode.");
3132
var basePath = Thread.GetDomain().BaseDirectory;
3233
//Download the version information file from OSS to be updated.(JSON)
34+
GeneralTracer.Debug("2.Download the version information file from OSS to be updated.(JSON)");
3335
var versionsFilePath = Path.Combine(basePath, configGlobalConfigInfo.VersionFileName);
3436
DownloadFile(configGlobalConfigInfo.Url, versionsFilePath);
3537
if (!File.Exists(versionsFilePath)) return;
@@ -38,6 +40,7 @@ await Task.Run(() =>
3840
versions = versions.OrderByDescending(x => x.PubTime).ToList();
3941
var newVersion = versions.First();
4042
//Determine whether the current client version needs to be upgraded.
43+
GeneralTracer.Debug("3.Determine whether the current client version needs to be upgraded.");
4144
if (!IsUpgrade(configGlobalConfigInfo.CurrentVersion, newVersion.Version))
4245
return;
4346

@@ -46,6 +49,7 @@ await Task.Run(() =>
4649
if (!File.Exists(appPath))
4750
throw new Exception($"The application does not exist {upgradeAppName} !");
4851

52+
GeneralTracer.Debug("4.Start upgrade app.");
4953
var json = JsonSerializer.Serialize(configGlobalConfigInfo, GlobalConfigInfoOSSJsonContext.Default.GlobalConfigInfoOSS);
5054
Environments.SetEnvironmentVariable("GlobalConfigInfoOSS", json);
5155
Process.Start(appPath);

0 commit comments

Comments
 (0)