diff --git a/src/LibraryViewExtensionWebView2/LibraryViewController.cs b/src/LibraryViewExtensionWebView2/LibraryViewController.cs index d96db91fcce..0746a863cec 100644 --- a/src/LibraryViewExtensionWebView2/LibraryViewController.cs +++ b/src/LibraryViewExtensionWebView2/LibraryViewController.cs @@ -9,6 +9,7 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Input; +using System.Windows.Interop; using CoreNodeModels.Properties; using Dynamo.Extensions; using Dynamo.LibraryViewExtensionWebView2.Handlers; @@ -704,7 +705,14 @@ internal void UpdatePopupLocation() /// internal void LogToDynamoConsole(string message) { - this.dynamoViewModel?.Model?.Logger?.Log(message); + if (DynamoModel.IsTestMode) + { + System.Console.WriteLine(message); + } + else + { + this.dynamoViewModel?.Model?.Logger?.Log(message); + } } public void Dispose() diff --git a/src/Notifications/NotificationCenterController.cs b/src/Notifications/NotificationCenterController.cs index 8902b7496d5..43476773507 100755 --- a/src/Notifications/NotificationCenterController.cs +++ b/src/Notifications/NotificationCenterController.cs @@ -233,9 +233,9 @@ private void WebView_CoreWebView2InitializationCompleted(object sender, Microsof { if (e.InitializationException != null) { - LogToDynamoConsole(e.InitializationException.Message); + Log(e.InitializationException.Message); } - LogToDynamoConsole("NotificationCenter CoreWebView2 initialization failed."); + Log("NotificationCenter CoreWebView2 initialization failed."); return; } @@ -274,7 +274,7 @@ private void WebView_CoreWebView2InitializationCompleted(object sender, Microsof } catch (Exception ex) { - LogToDynamoConsole("NotificationCenter CoreWebView2 initialization failed: " + ex.Message); + Log("NotificationCenter CoreWebView2 initialization failed: " + ex.Message); } } }