From 408eb204430711691514465d2d987e1d1d865ec7 Mon Sep 17 00:00:00 2001 From: "Calvin A. Allen" Date: Mon, 29 Dec 2025 21:16:08 -0500 Subject: [PATCH] chore: removed unused logger --- .../Helpers/Logger.cs | 72 ------------------- 1 file changed, 72 deletions(-) delete mode 100644 src/CodingWithCalvin.OpenInNotepadPlusPlus/Helpers/Logger.cs diff --git a/src/CodingWithCalvin.OpenInNotepadPlusPlus/Helpers/Logger.cs b/src/CodingWithCalvin.OpenInNotepadPlusPlus/Helpers/Logger.cs deleted file mode 100644 index 21d66cc..0000000 --- a/src/CodingWithCalvin.OpenInNotepadPlusPlus/Helpers/Logger.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using Microsoft.VisualStudio.Shell; -using Microsoft.VisualStudio.Shell.Interop; - -namespace CodingWithCalvin.OpenInNotepadPlusPlus.Helpers -{ - public static class Logger - { - private static IVsOutputWindowPane _pane; - private static IServiceProvider _provider; - private static string _name; - - public static void Initialize(Package provider, string name) - { - _provider = provider; - _name = name; - } - - public static void Log(string message) - { - if (string.IsNullOrEmpty(message)) - { - return; - } - - try - { - if (!EnsurePane()) - { - return; - } - ThreadHelper.ThrowIfNotOnUIThread(); - - _pane.OutputStringThreadSafe(DateTime.Now + ": " + message + Environment.NewLine); - } - catch (Exception ex) - { - System.Diagnostics.Debug.WriteLine(ex); - } - } - - public static void Log(Exception ex) - { - if (ex == null) - { - return; - } - - ThreadHelper.ThrowIfNotOnUIThread(); - Log(ex.ToString()); - } - - private static bool EnsurePane() - { - ThreadHelper.ThrowIfNotOnUIThread(); - - if (_pane == null) - { - var guid = Guid.NewGuid(); - var output = _provider.GetService(typeof(SVsOutputWindow)) as IVsOutputWindow; - if (output == null) - { - throw new ArgumentNullException(nameof(output)); - } - output.CreatePane(ref guid, _name, 1, 1); - output.GetPane(ref guid, out _pane); - } - - return _pane != null; - } - } -}