Skip to content

Commit b73d7f9

Browse files
committed
Add debug tracing to OSS upgrade process
Inserted GeneralTracer.Debug statements throughout the OSS upgrade workflow to provide step-by-step logging for easier troubleshooting and monitoring. This includes tracing the start of the upgrade, each major step in the process, and completion.
1 parent d7b1c72 commit b73d7f9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/c#/GeneralUpdate.Core/GeneralUpdateOSS.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ private static async Task BaseStart()
3232
{
3333
try
3434
{
35+
GeneralTracer.Debug("Starting OSS upgrade mode.");
3536
var json = Environments.GetEnvironmentVariable("GlobalConfigInfoOSS");
3637
if (string.IsNullOrWhiteSpace(json))
3738
return;

src/c#/GeneralUpdate.Core/Strategys/OSSStrategy.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,25 @@ public async Task ExecuteAsync()
3434
try
3535
{
3636
//1.Download the JSON version configuration file.
37+
GeneralTracer.Debug("1.Download the JSON version configuration file.");
3738
var jsonPath = Path.Combine(_appPath, _parameter.VersionFileName);
3839
if (!File.Exists(jsonPath))
3940
throw new FileNotFoundException(jsonPath);
4041

4142
//2.Parse the JSON version configuration file content.
43+
GeneralTracer.Debug("2.Parse the JSON version configuration file content.");
4244
var versions = StorageManager.GetJson<List<VersionOSS>>(jsonPath, VersionOSSJsonContext.Default.ListVersionOSS);
4345
if (versions == null)
4446
throw new NullReferenceException(nameof(versions));
4547

4648
versions = versions.OrderBy(v => v.PubTime).ToList();
4749
//3.Download version by version according to the version of the configuration file.
50+
GeneralTracer.Debug("3.Download version by version according to the version of the configuration file.");
4851
await DownloadVersions(versions);
4952
Decompress(versions);
5053

5154
//4.Launch the main application.
55+
GeneralTracer.Debug("4.Launch the main application.");
5256
LaunchApp();
5357
}
5458
catch (Exception ex)
@@ -97,6 +101,8 @@ private void LaunchApp()
97101
var appPath = Path.Combine(_appPath, _parameter.AppName);
98102
if (!File.Exists(appPath)) throw new FileNotFoundException($"{nameof(appPath)} , The application is not accessible !");
99103
Process.Start(appPath);
104+
105+
GeneralTracer.Debug("5.Upgrade complete.");
100106
}
101107

102108
private void Decompress(List<VersionOSS> versions)

0 commit comments

Comments
 (0)