mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-07-14 12:47:57 +00:00
Restore logging
This commit is contained in:
@@ -32,8 +32,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Debug trace - useful for diagnostics
|
||||
System.Diagnostics.Debug.WriteLine($"Probe scored for launch origin: DotNet {scoreDotNet} vs. {scoreElectron} Electron");
|
||||
Console.WriteLine("Probe scored for launch origin: DotNet {0} vs. {1} Electron", scoreDotNet, scoreElectron);
|
||||
return scoreDotNet > scoreElectron;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,8 +38,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Debug trace - useful for diagnostics
|
||||
System.Diagnostics.Debug.WriteLine($"Probe scored for package mode: Unpackaged {scoreUnpackaged} vs. {scorePackaged} Packaged");
|
||||
Console.WriteLine("Probe scored for package mode: Unpackaged {0} vs. {1} Packaged", scoreUnpackaged, scorePackaged);
|
||||
return scoreUnpackaged > scorePackaged;
|
||||
}
|
||||
|
||||
|
||||
@@ -161,8 +161,8 @@
|
||||
{
|
||||
await Task.Delay(10.ms()).ConfigureAwait(false);
|
||||
|
||||
System.Diagnostics.Debug.WriteLine($"[StartInternal]: startCmd: {startCmd}");
|
||||
System.Diagnostics.Debug.WriteLine($"[StartInternal]: args: {args}");
|
||||
Console.Error.WriteLine("[StartInternal]: startCmd: {0}", startCmd);
|
||||
Console.Error.WriteLine("[StartInternal]: args: {0}", args);
|
||||
|
||||
this.process = new ProcessRunner("ElectronRunner");
|
||||
this.process.ProcessExited += this.Process_Exited;
|
||||
@@ -170,10 +170,12 @@
|
||||
|
||||
await Task.Delay(500.ms()).ConfigureAwait(false);
|
||||
|
||||
Console.Error.WriteLine("[StartInternal]: after run:");
|
||||
|
||||
if (!this.process.IsRunning)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"[StartInternal]: Process is not running: {this.process.StandardError}");
|
||||
System.Diagnostics.Debug.WriteLine($"[StartInternal]: Process is not running: {this.process.StandardOutput}");
|
||||
Console.Error.WriteLine("[StartInternal]: Process is not running: " + this.process.StandardError);
|
||||
Console.Error.WriteLine("[StartInternal]: Process is not running: " + this.process.StandardOutput);
|
||||
|
||||
Task.Run(() => this.TransitionState(LifetimeState.Stopped));
|
||||
|
||||
@@ -184,9 +186,9 @@
|
||||
}
|
||||
catch (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}");
|
||||
Console.Error.WriteLine("[StartInternal]: Exception: " + this.process?.StandardError);
|
||||
Console.Error.WriteLine("[StartInternal]: Exception: " + this.process?.StandardOutput);
|
||||
Console.Error.WriteLine("[StartInternal]: Exception: " + ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,12 +13,9 @@
|
||||
{
|
||||
public void Initialize()
|
||||
{
|
||||
var startTime = System.Diagnostics.Stopwatch.StartNew();
|
||||
|
||||
try
|
||||
{
|
||||
ElectronNetRuntime.BuildInfo = this.GatherBuildInfo();
|
||||
System.Diagnostics.Debug.WriteLine($"[Startup] GatherBuildInfo: {startTime.ElapsedMilliseconds}ms");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -27,18 +24,13 @@
|
||||
|
||||
this.CollectProcessData();
|
||||
this.SetElectronExecutable();
|
||||
System.Diagnostics.Debug.WriteLine($"[Startup] CollectProcessData+SetElectronExecutable: {startTime.ElapsedMilliseconds}ms");
|
||||
|
||||
ElectronNetRuntime.StartupMethod = this.DetectAppTypeAndStartup();
|
||||
System.Diagnostics.Debug.WriteLine($"Evaluated StartupMethod: {ElectronNetRuntime.StartupMethod}");
|
||||
System.Diagnostics.Debug.WriteLine($"[Startup] DetectAppTypeAndStartup: {startTime.ElapsedMilliseconds}ms");
|
||||
|
||||
if (ElectronNetRuntime.DotnetAppType != DotnetAppType.AspNetCoreApp)
|
||||
{
|
||||
ElectronNetRuntime.RuntimeControllerCore = this.CreateRuntimeController();
|
||||
}
|
||||
|
||||
System.Diagnostics.Debug.WriteLine($"[Startup] Total StartupManager.Initialize: {startTime.ElapsedMilliseconds}ms");
|
||||
}
|
||||
|
||||
private RuntimeControllerBase CreateRuntimeController()
|
||||
@@ -142,18 +134,18 @@
|
||||
|
||||
if (electronAssembly == null)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("GatherBuildInfo: Early exit");
|
||||
Console.WriteLine("GatherBuildInfo: Early exit");
|
||||
return buildInfo;
|
||||
}
|
||||
|
||||
if (electronAssembly.GetName().Name == "testhost" || electronAssembly.GetName().Name == "ReSharperTestRunner")
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("GatherBuildInfo: Detected testhost");
|
||||
Console.WriteLine("GatherBuildInfo: Detected testhost");
|
||||
electronAssembly = AppDomain.CurrentDomain.GetData("ElectronTestAssembly") as Assembly ?? electronAssembly;
|
||||
}
|
||||
else
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("GatherBuildInfo: No testhost detected: " + electronAssembly.GetName().Name);
|
||||
Console.WriteLine("GatherBuildInfo: No testhost detected: " + electronAssembly.GetName().Name);
|
||||
}
|
||||
|
||||
var attributes = electronAssembly.GetCustomAttributes<AssemblyMetadataAttribute>().ToList();
|
||||
|
||||
Reference in New Issue
Block a user