From ff17e3dec911d560eb964ef95f81c00b941e7e6a Mon Sep 17 00:00:00 2001 From: Den Delimarsky Date: Fri, 27 Sep 2024 12:38:42 -0700 Subject: [PATCH] [Awake]Log error with Logger instead of console (#35100) --- .pipelines/v2/ci.yml | 2 +- src/modules/awake/Awake/Core/Manager.cs | 1 - .../Core/Threading/SingleThreadSynchronizationContext.cs | 6 ++++-- src/modules/awake/Awake/Program.cs | 1 - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pipelines/v2/ci.yml b/.pipelines/v2/ci.yml index 268bea7d11..5e7bf26676 100644 --- a/.pipelines/v2/ci.yml +++ b/.pipelines/v2/ci.yml @@ -32,7 +32,7 @@ parameters: - name: enableMsBuildCaching type: boolean displayName: "Enable MSBuild Caching" - default: true + default: false - name: runTests type: boolean displayName: "Run Tests" diff --git a/src/modules/awake/Awake/Core/Manager.cs b/src/modules/awake/Awake/Core/Manager.cs index ba69f9c8df..f237250635 100644 --- a/src/modules/awake/Awake/Core/Manager.cs +++ b/src/modules/awake/Awake/Core/Manager.cs @@ -14,7 +14,6 @@ using System.Runtime.InteropServices; using System.Text; using System.Text.Json; using System.Threading; - using Awake.Core.Models; using Awake.Core.Native; using Awake.Properties; diff --git a/src/modules/awake/Awake/Core/Threading/SingleThreadSynchronizationContext.cs b/src/modules/awake/Awake/Core/Threading/SingleThreadSynchronizationContext.cs index 4b432320d9..04c28dfd34 100644 --- a/src/modules/awake/Awake/Core/Threading/SingleThreadSynchronizationContext.cs +++ b/src/modules/awake/Awake/Core/Threading/SingleThreadSynchronizationContext.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Threading; +using ManagedCommon; namespace Awake.Core.Threading { @@ -49,7 +50,7 @@ namespace Awake.Core.Threading } catch (Exception e) { - Console.WriteLine("Error during execution: " + e.Message); + Logger.LogError("Error during execution of the STS context message loop: " + e.Message); } } } @@ -58,7 +59,8 @@ namespace Awake.Core.Threading { lock (queue) { - queue.Enqueue(null); // Signal the end of the message loop + // Signal the end of the message loop + queue.Enqueue(null); Monitor.Pulse(queue); } } diff --git a/src/modules/awake/Awake/Program.cs b/src/modules/awake/Awake/Program.cs index 2dd22db874..d1311ef51f 100644 --- a/src/modules/awake/Awake/Program.cs +++ b/src/modules/awake/Awake/Program.cs @@ -15,7 +15,6 @@ using System.Reflection; using System.Text.Json; using System.Threading; using System.Threading.Tasks; - using Awake.Core; using Awake.Core.Models; using Awake.Core.Native;