diff --git a/src/ElectronNET.API/Runtime/Helpers/LaunchOrderDetector.cs b/src/ElectronNET.API/Runtime/Helpers/LaunchOrderDetector.cs index f789eed..0953516 100644 --- a/src/ElectronNET.API/Runtime/Helpers/LaunchOrderDetector.cs +++ b/src/ElectronNET.API/Runtime/Helpers/LaunchOrderDetector.cs @@ -32,7 +32,8 @@ } } - Console.WriteLine("Probe scored for launch origin: DotNet {0} vs. {1} Electron", scoreDotNet, scoreElectron); + // Debug trace - useful for diagnostics + System.Diagnostics.Debug.WriteLine($"Probe scored for launch origin: DotNet {scoreDotNet} vs. {scoreElectron} Electron"); return scoreDotNet > scoreElectron; } diff --git a/src/ElectronNET.API/Runtime/Helpers/UnpackagedDetector.cs b/src/ElectronNET.API/Runtime/Helpers/UnpackagedDetector.cs index a6fc3f1..46fdee1 100644 --- a/src/ElectronNET.API/Runtime/Helpers/UnpackagedDetector.cs +++ b/src/ElectronNET.API/Runtime/Helpers/UnpackagedDetector.cs @@ -38,7 +38,8 @@ } } - Console.WriteLine("Probe scored for package mode: Unpackaged {0} vs. {1} Packaged", scoreUnpackaged, scorePackaged); + // Debug trace - useful for diagnostics + System.Diagnostics.Debug.WriteLine($"Probe scored for package mode: Unpackaged {scoreUnpackaged} vs. {scorePackaged} Packaged"); return scoreUnpackaged > scorePackaged; } diff --git a/src/ElectronNET.API/Runtime/Services/ElectronProcess/ElectronProcessActive.cs b/src/ElectronNET.API/Runtime/Services/ElectronProcess/ElectronProcessActive.cs index b2d32a9..b104408 100644 --- a/src/ElectronNET.API/Runtime/Services/ElectronProcess/ElectronProcessActive.cs +++ b/src/ElectronNET.API/Runtime/Services/ElectronProcess/ElectronProcessActive.cs @@ -161,8 +161,8 @@ { await Task.Delay(10.ms()).ConfigureAwait(false); - Console.Error.WriteLine("[StartInternal]: startCmd: {0}", startCmd); - Console.Error.WriteLine("[StartInternal]: args: {0}", args); + System.Diagnostics.Debug.WriteLine($"[StartInternal]: startCmd: {startCmd}"); + System.Diagnostics.Debug.WriteLine($"[StartInternal]: args: {args}"); this.process = new ProcessRunner("ElectronRunner"); this.process.ProcessExited += this.Process_Exited; @@ -170,12 +170,10 @@ await Task.Delay(500.ms()).ConfigureAwait(false); - Console.Error.WriteLine("[StartInternal]: after run:"); - if (!this.process.IsRunning) { - Console.Error.WriteLine("[StartInternal]: Process is not running: " + this.process.StandardError); - Console.Error.WriteLine("[StartInternal]: Process is not running: " + this.process.StandardOutput); + System.Diagnostics.Debug.WriteLine($"[StartInternal]: Process is not running: {this.process.StandardError}"); + System.Diagnostics.Debug.WriteLine($"[StartInternal]: Process is not running: {this.process.StandardOutput}"); Task.Run(() => this.TransitionState(LifetimeState.Stopped)); @@ -186,9 +184,9 @@ } catch (Exception ex) { - Console.Error.WriteLine("[StartInternal]: Exception: " + this.process?.StandardError); - Console.Error.WriteLine("[StartInternal]: Exception: " + this.process?.StandardOutput); - Console.Error.WriteLine("[StartInternal]: Exception: " + ex); + System.Diagnostics.Debug.WriteLine($"[StartInternal]: Exception: {this.process?.StandardError}"); + System.Diagnostics.Debug.WriteLine($"[StartInternal]: Exception: {this.process?.StandardOutput}"); + System.Diagnostics.Debug.WriteLine($"[StartInternal]: Exception: {ex}"); throw; } }