From 8c63b93d09da7e96ab59be306686aa44a71580b0 Mon Sep 17 00:00:00 2001 From: Chris Kaczor Date: Tue, 18 Aug 2026 14:43:22 -0400 Subject: [PATCH] Tweak logging and change settings string --- AudioDevice.cs | 3 +-- Delcom/StoplightIndicator.cs | 7 ++++++- Properties/Resources.Designer.cs | 2 +- Properties/Resources.resx | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/AudioDevice.cs b/AudioDevice.cs index 6c857c4..4bae320 100644 --- a/AudioDevice.cs +++ b/AudioDevice.cs @@ -3,7 +3,6 @@ using NAudio.CoreAudioApi.Interfaces; using Serilog; using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Windows.Threading; @@ -63,7 +62,7 @@ internal class AudioDevice : IAudioSessionEventsHandler void IAudioSessionEventsHandler.OnVolumeChanged(float volume, bool isMuted) { - _dispatcher.Invoke(() => { Debug.WriteLine($"{_device.DeviceFriendlyName}: {volume} {isMuted} {_device.AudioEndpointVolume.Mute}"); }); + _dispatcher.Invoke(() => { _logger.Information("{name}: {volume} {isMuted} {mute}", _device.DeviceFriendlyName, volume, isMuted, _device.AudioEndpointVolume.Mute); }); } void IAudioSessionEventsHandler.OnDisplayNameChanged(string displayName) diff --git a/Delcom/StoplightIndicator.cs b/Delcom/StoplightIndicator.cs index fa72683..777aab9 100644 --- a/Delcom/StoplightIndicator.cs +++ b/Delcom/StoplightIndicator.cs @@ -1,10 +1,13 @@ using System; using System.Diagnostics; +using Serilog; namespace WorkIndicator.Delcom { public class StoplightIndicator : IDisposable { + private readonly ILogger _logger; + public enum Light { Green, @@ -25,6 +28,8 @@ namespace WorkIndicator.Delcom public StoplightIndicator() { + _logger = Log.ForContext(); + Device = new Delcom(); Device.Open(); @@ -74,7 +79,7 @@ namespace WorkIndicator.Delcom _yellow = yellow; _green = green; - Debug.WriteLine($"Red: {_red}, Yellow: {_yellow}, Green: {_green}"); + _logger.Information("Red: {red}, Yellow: {yellow}, Green: {green}", _red, _yellow, _green); port1 = port1.SetBitValue((int) Light.Green, green == LightState.Off); port1 = port1.SetBitValue((int) Light.Yellow, yellow == LightState.Off); diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 9942909..7aee4ea 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -188,7 +188,7 @@ namespace WorkIndicator.Properties { } /// - /// Looks up a localized string similar to Settings. + /// Looks up a localized string similar to Settings.... /// public static string NotificationIconContextMenuSettings { get { diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 3617650..ece5963 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -201,7 +201,7 @@ Would you like to download and install it now? Talking - Settings + Settings... Free