Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSafia Abdalla <safia@microsoft.com>2020-05-26 20:09:54 +0300
committerGitHub <noreply@github.com>2020-05-26 20:09:54 +0300
commit9b98da360a3051a4d75a716048960840fb1b9b6d (patch)
tree7c6dce5a51ae98b01f1433f9ba4ec8e040102b83
parenta005b6bc332f81b9cf9a7a6e2d4cdab51edec12a (diff)
Fix logging config and output redirection in DebugProxy (#22157)
* Fix logging config and output redirection in DebugProxy * Log all messages from DebugProxy
-rw-r--r--src/Components/WebAssembly/DebugProxy/src/Hosting/DebugProxyHost.cs2
-rw-r--r--src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/DevToolsProxy.cs4
-rw-r--r--src/Components/WebAssembly/Server/src/DebugProxyLauncher.cs9
3 files changed, 13 insertions, 2 deletions
diff --git a/src/Components/WebAssembly/DebugProxy/src/Hosting/DebugProxyHost.cs b/src/Components/WebAssembly/DebugProxy/src/Hosting/DebugProxyHost.cs
index 8a710028a0..4dfa2f44a2 100644
--- a/src/Components/WebAssembly/DebugProxy/src/Hosting/DebugProxyHost.cs
+++ b/src/Components/WebAssembly/DebugProxy/src/Hosting/DebugProxyHost.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
+using System.IO;
using System.Text;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
@@ -31,6 +32,7 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.DebugProxy.Hosting
{
config.AddCommandLine(args);
}
+ config.SetBasePath(Directory.GetCurrentDirectory());
config.AddJsonFile("blazor-debugproxysettings.json", optional: true, reloadOnChange: true);
})
.ConfigureLogging((hostingContext, logging) =>
diff --git a/src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/DevToolsProxy.cs b/src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/DevToolsProxy.cs
index 1cc711809a..5eac86d124 100644
--- a/src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/DevToolsProxy.cs
+++ b/src/Components/WebAssembly/DebugProxy/src/MonoDebugProxy/ws-proxy/DevToolsProxy.cs
@@ -320,10 +320,10 @@ namespace WebAssembly.Net.Debugging {
{
switch (priority) {
case "protocol":
- //logger.LogTrace (msg);
+ logger.LogTrace (msg);
break;
case "verbose":
- //logger.LogDebug (msg);
+ logger.LogDebug (msg);
break;
case "info":
case "warning":
diff --git a/src/Components/WebAssembly/Server/src/DebugProxyLauncher.cs b/src/Components/WebAssembly/Server/src/DebugProxyLauncher.cs
index 1a1ba6b85e..a8351af106 100644
--- a/src/Components/WebAssembly/Server/src/DebugProxyLauncher.cs
+++ b/src/Components/WebAssembly/Server/src/DebugProxyLauncher.cs
@@ -55,6 +55,7 @@ namespace Microsoft.AspNetCore.Builder
RemoveUnwantedEnvironmentVariables(processStartInfo.Environment);
var debugProxyProcess = Process.Start(processStartInfo);
+ PassThroughConsoleOutput(debugProxyProcess);
CompleteTaskWhenServerIsReady(debugProxyProcess, tcs);
new CancellationTokenSource(DebugProxyLaunchTimeout).Token.Register(() =>
@@ -97,6 +98,14 @@ namespace Microsoft.AspNetCore.Builder
return debugProxyPath;
}
+ private static void PassThroughConsoleOutput(Process process)
+ {
+ process.OutputDataReceived += (sender, eventArgs) =>
+ {
+ Console.WriteLine(eventArgs.Data);
+ };
+ }
+
private static void CompleteTaskWhenServerIsReady(Process aspNetProcess, TaskCompletionSource<string> taskCompletionSource)
{
string capturedUrl = null;