Skip to content

Commit

Permalink
Align log methods
Browse files Browse the repository at this point in the history
  • Loading branch information
QilongTang committed Jun 11, 2024
1 parent 6e4b782 commit 9d6475d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion src/LibraryViewExtensionWebView2/LibraryViewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -704,7 +705,14 @@ internal void UpdatePopupLocation()
/// <param name="meessage"></param>
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()
Expand Down
6 changes: 3 additions & 3 deletions src/Notifications/NotificationCenterController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit 9d6475d

Please sign in to comment.