From 6f802fa98a75048460f7a36a76ab8bf3781772e7 Mon Sep 17 00:00:00 2001 From: Hirogen Date: Fri, 6 Mar 2026 20:56:07 +0100 Subject: [PATCH 1/6] fixing csv problem... and a few others... --- build/_build.csproj | 4 +- src/ColumnizerLib/Column.cs | 4 +- .../IAutoLogLineColumnizerCallback.cs | 1 + .../IAutoLogLineMemoryColumnizerCallback.cs | 2 +- src/ColumnizerLib/IColumnizerConfigurator.cs | 1 + .../IColumnizerConfiguratorMemory.cs | 13 +- src/ColumnizerLib/IContextMenuEntry.cs | 4 +- src/ColumnizerLib/IInitColumnizer.cs | 1 + src/ColumnizerLib/IInitColumnizerMemory.cs | 2 +- .../ILogLineColumnizerCallback.cs | 1 + .../ILogLineMemoryColumnizerCallback.cs | 24 +++- src/CsvColumnizer/CsvColumnizer.cs | 14 +- src/CsvColumnizer/CsvColumnizerConfig.cs | 11 +- .../Callback/ColumnizerCallback.cs | 7 +- .../Callback/ColumnizerCallbackMemory.cs | 5 - src/LogExpert.Core/Classes/Log/LogBuffer.cs | 19 +-- .../Classes/Log/LogfileReader.cs | 17 +-- src/LogExpert.Core/Classes/ParamParser.cs | 8 +- src/LogExpert.Core/Classes/Util.cs | 9 ++ src/LogExpert.Core/Interface/ILogWindow.cs | 13 -- .../Controls/LogWindow/LogWindow.cs | 130 ++++++++++-------- src/LogExpert.UI/Dialogs/Eminus/Eminus.cs | 95 +++++++------ .../Dialogs/FilterSelectorForm.cs | 8 +- src/LogExpert.UI/Entities/ArgParser.cs | 4 +- .../Interface/ILogPaintContextUI.cs | 2 - src/LogExpert.sln | 1 + 26 files changed, 210 insertions(+), 190 deletions(-) diff --git a/build/_build.csproj b/build/_build.csproj index 9f884f23..905a8dec 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -1,11 +1,11 @@ - + Exe net10.0 False - CS0649;CS0169 + CS0649;CS0169;CS9107 1 diff --git a/src/ColumnizerLib/Column.cs b/src/ColumnizerLib/Column.cs index 3d59e285..82702862 100644 --- a/src/ColumnizerLib/Column.cs +++ b/src/ColumnizerLib/Column.cs @@ -41,10 +41,10 @@ static Column () public static IColumnMemory EmptyColumn { get; } - [Obsolete] + [Obsolete("Use IColumnizedLogLineMemory Parent Property")] IColumnizedLogLine IColumn.Parent { get; } - [Obsolete] + [Obsolete("Use ReadOnlyMemory FullValue")] string IColumn.FullValue { get; diff --git a/src/ColumnizerLib/IAutoLogLineColumnizerCallback.cs b/src/ColumnizerLib/IAutoLogLineColumnizerCallback.cs index 15ea9097..7a07c63c 100644 --- a/src/ColumnizerLib/IAutoLogLineColumnizerCallback.cs +++ b/src/ColumnizerLib/IAutoLogLineColumnizerCallback.cs @@ -1,5 +1,6 @@ namespace ColumnizerLib; +[Obsolete("This interface is deprecated. Use IAutoLogLineMemoryColumnizerCallback instead.")] public interface IAutoLogLineColumnizerCallback { /// diff --git a/src/ColumnizerLib/IAutoLogLineMemoryColumnizerCallback.cs b/src/ColumnizerLib/IAutoLogLineMemoryColumnizerCallback.cs index a6915d5a..276b4369 100644 --- a/src/ColumnizerLib/IAutoLogLineMemoryColumnizerCallback.cs +++ b/src/ColumnizerLib/IAutoLogLineMemoryColumnizerCallback.cs @@ -1,6 +1,6 @@ namespace ColumnizerLib; -public interface IAutoLogLineMemoryColumnizerCallback : IAutoLogLineColumnizerCallback +public interface IAutoLogLineMemoryColumnizerCallback { /// /// Returns the log line with the given index (zero-based). diff --git a/src/ColumnizerLib/IColumnizerConfigurator.cs b/src/ColumnizerLib/IColumnizerConfigurator.cs index 57cc268b..5ea2f387 100644 --- a/src/ColumnizerLib/IColumnizerConfigurator.cs +++ b/src/ColumnizerLib/IColumnizerConfigurator.cs @@ -5,6 +5,7 @@ namespace ColumnizerLib; /// The Config button in LogExpert's columnizer dialog is enabled if a Columnizer implements this interface. /// If you don't need a config dialog you don't have to implement this interface. /// +[Obsolete("This interface is deprecated. Please implement IColumnizerConfiguratorMemory instead.")] public interface IColumnizerConfigurator { #region Public methods diff --git a/src/ColumnizerLib/IColumnizerConfiguratorMemory.cs b/src/ColumnizerLib/IColumnizerConfiguratorMemory.cs index 10f28474..0662529c 100644 --- a/src/ColumnizerLib/IColumnizerConfiguratorMemory.cs +++ b/src/ColumnizerLib/IColumnizerConfiguratorMemory.cs @@ -5,7 +5,7 @@ namespace ColumnizerLib; /// The Config button in LogExpert's columnizer dialog is enabled if a Columnizer implements this interface. /// If you don't need a config dialog you don't have to implement this interface. /// -public interface IColumnizerConfiguratorMemory : IColumnizerConfigurator +public interface IColumnizerConfiguratorMemory { #region Public methods @@ -29,5 +29,16 @@ public interface IColumnizerConfiguratorMemory : IColumnizerConfigurator /// void Configure (ILogLineMemoryColumnizerCallback callback, string configDir); + /// + /// This function will be called right after LogExpert has loaded your Columnizer class. Use this + /// to load the configuration which was saved in the Configure() function. + /// You have to hold the loaded config data in your Columnizer object. + /// + /// The complete path to the directory where LogExpert stores its settings. + /// You can use this directory, if you want to. Please don't use the file name "settings.dat", because this + /// name is used by LogExpert. + /// + void LoadConfig (string configDir); + #endregion } \ No newline at end of file diff --git a/src/ColumnizerLib/IContextMenuEntry.cs b/src/ColumnizerLib/IContextMenuEntry.cs index a0baf341..05ba1f8e 100644 --- a/src/ColumnizerLib/IContextMenuEntry.cs +++ b/src/ColumnizerLib/IContextMenuEntry.cs @@ -34,7 +34,7 @@ public interface IContextMenuEntry /// string GetMenuText (IList loglines, ILogLineMemoryColumnizer columnizer, ILogExpertCallback callback); - string GetMenuText (int linesCount, ILogLineMemoryColumnizer columnizer, ILogLine logline); + string GetMenuText (int linesCount, ILogLineMemoryColumnizer columnizer, ILogLineMemory logline); /// @@ -48,7 +48,7 @@ public interface IContextMenuEntry /// for retrieving log lines or pass it along to functions of the Columnizer if needed. void MenuSelected (IList loglines, ILogLineMemoryColumnizer columnizer, ILogExpertCallback callback); - void MenuSelected (int linesCount, ILogLineMemoryColumnizer columnizer, ILogLine logline); + void MenuSelected (int linesCount, ILogLineMemoryColumnizer columnizer, ILogLineMemory logline); #endregion } \ No newline at end of file diff --git a/src/ColumnizerLib/IInitColumnizer.cs b/src/ColumnizerLib/IInitColumnizer.cs index 61d9e261..f20f1218 100644 --- a/src/ColumnizerLib/IInitColumnizer.cs +++ b/src/ColumnizerLib/IInitColumnizer.cs @@ -16,6 +16,7 @@ namespace ColumnizerLib; /// retrieve specific lines. /// /// +[Obsolete("This interface is deprecated. Use IInitColumnizerMemory instead and implement the Selected and DeSelected methods there.")] public interface IInitColumnizer { #region Public methods diff --git a/src/ColumnizerLib/IInitColumnizerMemory.cs b/src/ColumnizerLib/IInitColumnizerMemory.cs index 8d9c48a6..94144189 100644 --- a/src/ColumnizerLib/IInitColumnizerMemory.cs +++ b/src/ColumnizerLib/IInitColumnizerMemory.cs @@ -16,7 +16,7 @@ namespace ColumnizerLib; /// retrieve specific lines. /// /// -public interface IInitColumnizerMemory : IInitColumnizer +public interface IInitColumnizerMemory { #region Public methods diff --git a/src/ColumnizerLib/ILogLineColumnizerCallback.cs b/src/ColumnizerLib/ILogLineColumnizerCallback.cs index 74d25b83..845451a3 100644 --- a/src/ColumnizerLib/ILogLineColumnizerCallback.cs +++ b/src/ColumnizerLib/ILogLineColumnizerCallback.cs @@ -12,6 +12,7 @@ namespace ColumnizerLib; ///An example would be when the log lines contains only the time of day but the date is coded in the file name. In this situation ///you can use the GetFileName() function to retrieve the name of the current file to build a complete timestamp. /// +[Obsolete("This interface is deprecated and will be removed in a future version. Please use ILogLineMemoryColumnizerCallback instead.")] public interface ILogLineColumnizerCallback { #region Public methods diff --git a/src/ColumnizerLib/ILogLineMemoryColumnizerCallback.cs b/src/ColumnizerLib/ILogLineMemoryColumnizerCallback.cs index 9833d190..2abf2be7 100644 --- a/src/ColumnizerLib/ILogLineMemoryColumnizerCallback.cs +++ b/src/ColumnizerLib/ILogLineMemoryColumnizerCallback.cs @@ -4,12 +4,30 @@ namespace ColumnizerLib; /// Defines a callback interface for retrieving memory-based representations of individual log lines by line number. /// /// Implementations of this interface enable columnizers to access log line data in a memory-efficient -/// format, which may improve performance when processing large log files. This interface extends to provide additional capabilities for memory-based log line access. -public interface ILogLineMemoryColumnizerCallback : ILogLineColumnizerCallback +/// format, which may improve performance when processing large log files. +public interface ILogLineMemoryColumnizerCallback { #region Public methods + /// + /// This property returns the current line number. That is the line number of the log line + /// a ILogLineColumnizer function is called for (e.g. the line that has to be painted). + /// + /// The current line number starting at 0 + int LineNum { get; } + + /// + /// Returns the full file name (path + name) of the current log file. + /// + /// File name of current log file + string GetFileName (); + + /// + /// Returns the number of lines of the logfile. + /// + /// Number of lines. + int GetLineCount (); + /// /// Retrieves the memory representation of the log line at the specified line number. /// diff --git a/src/CsvColumnizer/CsvColumnizer.cs b/src/CsvColumnizer/CsvColumnizer.cs index 12b065f3..1d475c46 100644 --- a/src/CsvColumnizer/CsvColumnizer.cs +++ b/src/CsvColumnizer/CsvColumnizer.cs @@ -24,9 +24,9 @@ public class CsvColumnizer : ILogLineMemoryColumnizer, IInitColumnizerMemory, IC private const string CONFIGFILENAME = "csvcolumnizer.json"; private readonly IList _columnList = []; - private CsvColumnizerConfig _config; + private CsvColumnizerConfig _config = CreateDefaultConfig(); - private ILogLine _firstLine; + private ILogLineMemory _firstLine; // if CSV is detected to be 'invalid' the columnizer will behave like a default columnizer private bool _isValidCsv; @@ -41,6 +41,12 @@ public string PreProcessLine (string logLine, int lineNum, int realLineNum) return PreProcessLine(logLine.AsMemory(), lineNum, realLineNum).ToString(); } + private static CsvColumnizerConfig CreateDefaultConfig () + { + var config = new CsvColumnizerConfig(); + config.InitDefaults(); + return config; + } public ReadOnlyMemory PreProcessLine (ReadOnlyMemory logLine, int lineNum, int realLineNum) { @@ -49,7 +55,7 @@ public ReadOnlyMemory PreProcessLine (ReadOnlyMemory logLine, int li // store for later field names and field count retrieval _firstLine = new CsvLogLine(logLine, 0); - if (_config.MinColumns > 0) + if (_config != null && _config.MinColumns > 0) { using CsvReader csv = new(new StringReader(logLine.ToString()), _config.ReaderConfiguration); if (csv.Parser.Count < _config.MinColumns) @@ -191,7 +197,7 @@ public void Selected (ILogLineMemoryColumnizerCallback callback) if (line != null) { - using CsvReader csv = new(new StringReader(line.FullLine), _config.ReaderConfiguration); + using CsvReader csv = new(new StringReader(line.FullLine.ToString()), _config.ReaderConfiguration); _ = csv.Read(); _ = csv.ReadHeader(); diff --git a/src/CsvColumnizer/CsvColumnizerConfig.cs b/src/CsvColumnizer/CsvColumnizerConfig.cs index e2841bcf..0f8cfd00 100644 --- a/src/CsvColumnizer/CsvColumnizerConfig.cs +++ b/src/CsvColumnizer/CsvColumnizerConfig.cs @@ -1,9 +1,8 @@ -using CsvHelper.Configuration; +using System.Globalization; -using Newtonsoft.Json; +using CsvHelper.Configuration; -using System; -using System.Globalization; +using Newtonsoft.Json; namespace CsvColumnizer; @@ -33,7 +32,7 @@ public class CsvColumnizerConfig #region Public methods - public void InitDefaults() + public void InitDefaults () { ReaderConfiguration = new CsvConfiguration(CultureInfo.InvariantCulture) { @@ -53,7 +52,7 @@ public void InitDefaults() MinColumns = 0; } - public void ConfigureReaderConfiguration() + public void ConfigureReaderConfiguration () { ReaderConfiguration = new CsvConfiguration(CultureInfo.InvariantCulture) { diff --git a/src/LogExpert.Core/Callback/ColumnizerCallback.cs b/src/LogExpert.Core/Callback/ColumnizerCallback.cs index e8e6952c..25302049 100644 --- a/src/LogExpert.Core/Callback/ColumnizerCallback.cs +++ b/src/LogExpert.Core/Callback/ColumnizerCallback.cs @@ -4,7 +4,7 @@ namespace LogExpert.Core.Callback; -public class ColumnizerCallback (ILogWindow logWindow) : ILogLineMemoryColumnizerCallback, IAutoLogLineColumnizerCallback, ICloneable +public class ColumnizerCallback (ILogWindow logWindow) : ILogLineMemoryColumnizerCallback, IAutoLogLineMemoryColumnizerCallback, ICloneable { #region Fields private readonly ILogWindow _logWindow = logWindow; @@ -38,11 +38,6 @@ public string GetFileName () return _logWindow.GetCurrentFileName(LineNum); } - public ILogLine GetLogLine (int lineNum) - { - return _logWindow.GetLine(lineNum); - } - public int GetLineCount () { return _logWindow.LogFileReader.LineCount; diff --git a/src/LogExpert.Core/Callback/ColumnizerCallbackMemory.cs b/src/LogExpert.Core/Callback/ColumnizerCallbackMemory.cs index 4f09b0e1..03c95d46 100644 --- a/src/LogExpert.Core/Callback/ColumnizerCallbackMemory.cs +++ b/src/LogExpert.Core/Callback/ColumnizerCallbackMemory.cs @@ -38,11 +38,6 @@ public string GetFileName () return _logWindow.GetCurrentFileName(LineNum); } - public ILogLine GetLogLine (int lineNum) - { - return _logWindow.GetLine(lineNum); - } - public int GetLineCount () { return _logWindow.LogFileReader.LineCount; diff --git a/src/LogExpert.Core/Classes/Log/LogBuffer.cs b/src/LogExpert.Core/Classes/Log/LogBuffer.cs index 48bab407..2f9d05ca 100644 --- a/src/LogExpert.Core/Classes/Log/LogBuffer.cs +++ b/src/LogExpert.Core/Classes/Log/LogBuffer.cs @@ -14,7 +14,7 @@ public class LogBuffer private readonly IList _filePositions = []; // file position for every line #endif - private readonly List _lineList = new(); + private readonly List _lineList = []; private readonly IList _logLines = []; private int MAX_LINES = 500; @@ -74,16 +74,6 @@ public long Size #region Public methods - public void AddLine (ILogLine line, long filePos) - { - _logLines.Add(line); -#if DEBUG - _filePositions.Add(filePos); -#endif - LineCount++; - IsDisposed = false; - } - public void AddLine (ILogLineMemory lineMemory, long filePos) { _lineList.Add(lineMemory); @@ -111,13 +101,6 @@ public void DisposeContent () #endif } - public ILogLine GetLineOfBlock (int num) - { - return num < _logLines.Count && num >= 0 - ? _logLines[num] - : null; - } - public ILogLineMemory GetLineMemoryOfBlock (int num) { return num < _lineList.Count && num >= 0 diff --git a/src/LogExpert.Core/Classes/Log/LogfileReader.cs b/src/LogExpert.Core/Classes/Log/LogfileReader.cs index 1c373065..ffc2aff3 100644 --- a/src/LogExpert.Core/Classes/Log/LogfileReader.cs +++ b/src/LogExpert.Core/Classes/Log/LogfileReader.cs @@ -518,19 +518,6 @@ private void AcquireBufferListWriterLock () } } - /// - /// Retrieves the log line at the specified zero-based line number. - /// - /// This method blocks until the log line is available. If the specified line number is out of - /// range, an exception may be thrown. - /// The zero-based index of the log line to retrieve. Must be greater than or equal to 0 and less than the total - /// number of log lines. - /// An object representing the log line at the specified index. - public ILogLine GetLogLine (int lineNum) - { - return GetLogLineInternal(lineNum).Result; - } - //TODO Make Task Based public ILogLineMemory GetLogLineMemory (int lineNum) { @@ -966,7 +953,7 @@ private ILogFileInfo AddFile (string fileName) /// The zero-based line number of the log entry to retrieve. /// A task that represents the asynchronous operation. The task result contains the log line at the specified line /// number, or null if the file is deleted or the line does not exist. - private Task GetLogLineInternal (int lineNum) + private Task GetLogLineInternal (int lineNum) { if (_isDeleted) { @@ -997,7 +984,7 @@ private Task GetLogLineInternal (int lineNum) DowngradeDisposeLockFromWriterLock(); } - var line = logBuffer.GetLineOfBlock(lineNum - logBuffer.StartLine); + var line = logBuffer.GetLineMemoryOfBlock(lineNum - logBuffer.StartLine); ReleaseDisposeUpgradeableReadLock(); ReleaseBufferListReaderLock(); diff --git a/src/LogExpert.Core/Classes/ParamParser.cs b/src/LogExpert.Core/Classes/ParamParser.cs index dfbbfd8d..26a7838a 100644 --- a/src/LogExpert.Core/Classes/ParamParser.cs +++ b/src/LogExpert.Core/Classes/ParamParser.cs @@ -11,7 +11,7 @@ public class ParamParser (string argTemplate) { #region Public methods - public string ReplaceParams (ILogLine logLine, int lineNum, string fileName) + public string ReplaceParams (ILogLineMemory logLine, int lineNum, string fileName) { FileInfo fileInfo = new(fileName); StringBuilder builder = new(argTemplate); @@ -46,13 +46,13 @@ public string ReplaceParams (ILogLine logLine, int lineNum, string fileName) try { var regex = RegexHelper.GetOrCreateCached(reg); - var result = regex.Replace(logLine.FullLine, replace); - builder.Insert(sPos, result); + var result = regex.Replace(logLine.FullLine.ToString(), replace); + _ = builder.Insert(sPos, result); } catch (RegexMatchTimeoutException) { // If regex times out, insert the original pattern as fallback - builder.Insert(sPos, $"{{timeout: {reg}}}"); + _ = builder.Insert(sPos, $"{{timeout: {reg}}}"); } } } while (replace != null); diff --git a/src/LogExpert.Core/Classes/Util.cs b/src/LogExpert.Core/Classes/Util.cs index 3016dc46..18137729 100644 --- a/src/LogExpert.Core/Classes/Util.cs +++ b/src/LogExpert.Core/Classes/Util.cs @@ -181,6 +181,15 @@ public static unsafe int YetiLevenshtein (string s1, string s2) } } + public static unsafe int YetiLevenshtein (ReadOnlySpan s1, ReadOnlySpan s2) + { + fixed (char* p1 = s1) + fixed (char* p2 = s2) + { + return YetiLevenshtein(p1, s1.Length, p2, s2.Length, 0); + } + } + public static unsafe int YetiLevenshtein (string s1, string s2, int substitutionCost) { var xc = substitutionCost - 1; diff --git a/src/LogExpert.Core/Interface/ILogWindow.cs b/src/LogExpert.Core/Interface/ILogWindow.cs index 406ce15a..fa80ef9c 100644 --- a/src/LogExpert.Core/Interface/ILogWindow.cs +++ b/src/LogExpert.Core/Interface/ILogWindow.cs @@ -29,19 +29,6 @@ public interface ILogWindow /// string GetCurrentFileName (int lineNum); - /// - /// Gets the log line at the specified line number. - /// - /// The zero-based line number to retrieve. - /// - /// An object containing the line content and metadata, - /// or null if the line number is out of range or the line cannot be retrieved. - /// - /// - /// This method retrieves lines from the internal buffer cache and may trigger - /// disk reads if the line is not currently cached. - /// - ILogLine GetLine (int lineNum); /// /// Gets the log line at the specified line number asynchronously, with a timeout. diff --git a/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs b/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs index 13f1755d..ee38e79d 100644 --- a/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs +++ b/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs @@ -28,6 +28,8 @@ using NLog; +using Vanara.Extensions; + using WeifenLuo.WinFormsUI.Docking; //using static LogExpert.PluginRegistry.PluginRegistry; //TODO: Adjust the instance name so using static can be used. @@ -422,11 +424,6 @@ public bool IsMultiFile #region Public methods - public ILogLine GetLogLine (int lineNum) - { - return _logFileReader.GetLogLine(lineNum); - } - public ILogLineMemory GetLogLineMemory (int lineNum) { return _logFileReader.GetLogLineMemory(lineNum); @@ -1007,7 +1004,7 @@ private void OnDataGridViewCellValuePushed (object sender, DataGridViewCellValue return; } - var line = _logFileReader.GetLogLine(e.RowIndex); + var line = _logFileReader.GetLogLineMemory(e.RowIndex); var offset = CurrentColumnizer.GetTimeOffset(); CurrentColumnizer.SetTimeOffset(0); ColumnizerCallbackObject.SetLineNum(e.RowIndex); @@ -1021,7 +1018,8 @@ private void OnDataGridViewCellValuePushed (object sender, DataGridViewCellValue var oldValue = cols.ColumnValues[e.ColumnIndex - 2].FullValue; var newValue = (string)e.Value; //string oldValue = (string) this.dataGridView.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; - CurrentColumnizer.PushValue(ColumnizerCallbackObject, e.ColumnIndex - 2, newValue, oldValue); + //TODO OLD VALUE needs to be ReadOnlySpan + CurrentColumnizer.PushValue(ColumnizerCallbackObject, e.ColumnIndex - 2, newValue, oldValue.ToString()); dataGridView.Refresh(); TimeSpan timeSpan = new(CurrentColumnizer.GetTimeOffset() * TimeSpan.TicksPerMillisecond); var span = timeSpan.ToString(); @@ -1548,7 +1546,7 @@ private void OnHandlePluginContextMenu (object sender, EventArgs args) { var menuArgs = item.Tag as ContextMenuPluginEventArgs; var logLines = menuArgs.LogLines; - menuArgs.Entry.MenuSelected(logLines.Count, menuArgs.Columnizer, menuArgs.Callback.GetLogLine(logLines[0])); + menuArgs.Entry.MenuSelected(logLines.Count, menuArgs.Columnizer, menuArgs.Callback.GetLogLineMemory(logLines[0])); } } @@ -3357,9 +3355,9 @@ private void SetColumnizerInternal (ILogLineMemoryColumnizer columnizer) CurrentColumnizer = columnizer; } - (oldColumnizer as IInitColumnizer)?.DeSelected(new ColumnizerCallback(this)); + (oldColumnizer as IInitColumnizerMemory)?.DeSelected(new ColumnizerCallbackMemory(this)); - (columnizer as IInitColumnizer)?.Selected(new ColumnizerCallback(this)); + (columnizer as IInitColumnizerMemory)?.Selected(new ColumnizerCallbackMemory(this)); SetColumnizer(columnizer, dataGridView); SetColumnizer(columnizer, filterGridView); @@ -3951,7 +3949,7 @@ private int Search (SearchParams searchParams) } } - var line = _logFileReader.GetLogLine(lineNum); + var line = _logFileReader.GetLogLineMemory(lineNum); if (line == null) { return -1; @@ -3962,7 +3960,7 @@ private int Search (SearchParams searchParams) Regex rex = new(searchParams.SearchText, searchParams.IsCaseSensitive ? RegexOptions.None : RegexOptions.IgnoreCase); - if (rex.IsMatch(line.FullLine)) + if (rex.IsMatch(line.FullLine.ToString())) { return lineNum; } @@ -3971,14 +3969,14 @@ private int Search (SearchParams searchParams) { if (searchParams.IsCaseSensitive) { - if (line.FullLine.Contains(searchParams.SearchText, StringComparison.Ordinal)) + if (line.FullLine.Span.Contains(searchParams.SearchText, StringComparison.Ordinal)) { return lineNum; } } else { - if (line.FullLine.Contains(lowerSearchText, StringComparison.OrdinalIgnoreCase)) + if (line.FullLine.Span.Contains(lowerSearchText, StringComparison.OrdinalIgnoreCase)) { return lineNum; } @@ -5636,43 +5634,43 @@ private PatternBlock DetectBlock (int startNum, int startLineToSearch, int maxBl private void PrepareDict () { _lineHashList.Clear(); - Regex regex = new("\\d"); - Regex regex2 = new("\\S"); var num = _logFileReader.LineCount; for (var i = 0; i < num; ++i) { - var msg = GetMsgForLine(i); - if (msg != null) + var msgMemory = GetMsgForLine(i); + if (!msgMemory.IsEmpty) { - msg = msg.ToLowerInvariant(); - msg = regex.Replace(msg, "0"); - msg = regex2.Replace(msg, " "); - var chars = msg.ToCharArray(); + var span = msgMemory.Span; var value = 0; var numOfE = 0; var numOfA = 0; var numOfI = 0; - foreach (var t in chars) + + foreach (var c in span) { - value += t; - switch (t) + var lower = char.ToLowerInvariant(c); + + // TODO: verify that the normalization semantics are correct and intended: + // Normalize: \d → '0', then \S (non-whitespace) → ' ' + // Note: original applies \d first, then \S. Since '0' is non-whitespace, + // digits also become ' '. Effectively ALL non-whitespace → ' '. + // Verification is need that this is the intended behavior. + // If \S was meant to be \s (whitespace → space) or \D (non-digit → space), + // the hash semantics would differ significantly. + var normalized = char.IsWhiteSpace(lower) ? lower : ' '; + + value += normalized; + + switch (lower) { - case 'e': - numOfE++; - break; - case 'a': - numOfA++; - break; - case 'i': - numOfI++; - break; + case 'e': numOfE++; break; + case 'a': numOfA++; break; + case 'i': numOfI++; break; } } - value += numOfE * 30; - value += numOfA * 20; - value += numOfI * 10; + value += numOfE * 30 + numOfA * 20 + numOfI * 10; _lineHashList.Add(value); } } @@ -5714,11 +5712,11 @@ private int FindSimilarLine (int srcLine, int startLine, Dictionary pr var threshold = _patternArgs.Fuzzy; var prepared = false; - Regex regex = null; - Regex regex2 = null; string msgToFind = null; var culture = CultureInfo.CurrentCulture; + char[] normalizedBuffer = null; + var num = _logFileReader.LineCount; for (var i = startLine; i < num; ++i) { @@ -5738,30 +5736,50 @@ private int FindSimilarLine (int srcLine, int startLine, Dictionary pr { if (!prepared) { - msgToFind = GetMsgForLine(srcLine); - regex = ReplaceDigit(); - regex2 = ReplaceNonWordCharacters(); - msgToFind = msgToFind.ToLower(culture); - msgToFind = regex.Replace(msgToFind, "0"); - msgToFind = regex2.Replace(msgToFind, " "); + var srcMemory = GetMsgForLine(srcLine); + msgToFind = string.Create(srcMemory.Length, srcMemory, static (dest, src) => + { + var source = src.Span; + for (var j = 0; j < source.Length; ++j) + { + var c = char.ToLowerInvariant(source[j]); + dest[j] = char.IsDigit(c) ? '0' // \d -> '0', + : !char.IsLetterOrDigit(c) && c != '_' ? ' ' // \W -> ' ' + : c; + } + }); + prepared = true; } - var msg = GetMsgForLine(i); - if (msg != null) + var msgMemory = GetMsgForLine(i); + if (!msgMemory.IsEmpty) { - msg = regex.Replace(msg, "0"); - msg = regex2.Replace(msg, " "); - var lenDiff = Math.Abs(msg.Length - msgToFind.Length); + // Early length check — normalization preserves length, so check on span directly. + // Both \d→'0' and \W→' ' are 1:1 char replacements, length is unchanged. + var lenDiff = Math.Abs(msgMemory.Length - msgToFind.Length); if (lenDiff > threshold) { - //this.similarCache[srcLine, i] = lenDiff; continue; } - msg = msg.ToLower(culture); - var distance = Util.YetiLevenshtein(msgToFind, msg); - //this.similarCache[srcLine, i] = distance; + if (normalizedBuffer == null || normalizedBuffer.Length < msgMemory.Length) + { + normalizedBuffer = new char[msgMemory.Length]; + } + + var normalized = normalizedBuffer.AsSpan(0, msgMemory.Length); + + var source = msgMemory.Span; + for (var j = 0; j < source.Length; j++) + { + var c = char.ToLowerInvariant(source[j]); + normalized[j] = char.IsDigit(c) ? '0' + : !char.IsLetterOrDigit(c) && c != '_' ? ' ' + : c; + } + + var distance = Util.YetiLevenshtein(msgToFind.AsSpan(), normalized); if (distance < threshold) { return i; @@ -5773,9 +5791,9 @@ private int FindSimilarLine (int srcLine, int startLine, Dictionary pr return -1; } - private string GetMsgForLine (int i) + private ReadOnlyMemory GetMsgForLine (int i) { - var line = _logFileReader.GetLogLine(i); + var line = _logFileReader.GetLogLineMemory(i); var columnizer = CurrentColumnizer; ColumnizerCallback callback = new(this); var cols = columnizer.SplitLine(callback, line); diff --git a/src/LogExpert.UI/Dialogs/Eminus/Eminus.cs b/src/LogExpert.UI/Dialogs/Eminus/Eminus.cs index 01ef0a0b..1db268b2 100644 --- a/src/LogExpert.UI/Dialogs/Eminus/Eminus.cs +++ b/src/LogExpert.UI/Dialogs/Eminus/Eminus.cs @@ -1,3 +1,4 @@ +using System.Buffers; using System.Globalization; using System.Net.Sockets; using System.Runtime.Serialization; @@ -31,6 +32,8 @@ internal class Eminus : IContextMenuEntry, ILogExpertPluginConfigurator private EminusConfigDlg dlg; private EminusConfig tmpConfig = new(); + private static readonly SearchValues _delimiters = SearchValues.Create(['(', '$', '<']); + #endregion #region Properties @@ -42,14 +45,14 @@ internal class Eminus : IContextMenuEntry, ILogExpertPluginConfigurator #region Private Methods [SupportedOSPlatform("windows")] - private XmlDocument BuildParam (ILogLine line) + private XmlDocument BuildParam (ILogLineMemory line) { var fullLogLine = line.FullLine; // no Java stacktrace but some special logging of our applications at work: - if (fullLogLine.Contains(EXCEPTION_OF_TYPE, StringComparison.CurrentCulture) || - fullLogLine.Contains(NESTED, StringComparison.CurrentCulture)) + if (fullLogLine.Span.Contains(EXCEPTION_OF_TYPE, StringComparison.CurrentCulture) || + fullLogLine.Span.Contains(NESTED, StringComparison.CurrentCulture)) { - var pos = fullLogLine.IndexOf(CREATED_IN, StringComparison.OrdinalIgnoreCase); + var pos = fullLogLine.Span.IndexOf(CREATED_IN, StringComparison.OrdinalIgnoreCase); if (pos == -1) { @@ -57,68 +60,74 @@ private XmlDocument BuildParam (ILogLine line) } pos += CREATED_IN.Length; - var endPos = fullLogLine.IndexOf(DOT, pos, StringComparison.OrdinalIgnoreCase); + var endPos = fullLogLine.Span[pos..].IndexOf(DOT, StringComparison.OrdinalIgnoreCase); if (endPos == -1) { return null; } - var className = fullLogLine[pos..endPos]; - pos = fullLogLine.IndexOf(DOUBLE_DOT, pos, StringComparison.OrdinalIgnoreCase); + var className = fullLogLine[pos..(pos + endPos)].Span; - if (pos == -1) + var doubleDotPos = fullLogLine.Span[pos..].IndexOf(DOUBLE_DOT, StringComparison.OrdinalIgnoreCase); + if (doubleDotPos == -1) { return null; } - var lineNum = fullLogLine[(pos + 1)..]; + pos += doubleDotPos; + + var lineNum = fullLogLine[(pos + 1)..].Span; var doc = BuildXmlDocument(className, lineNum); return doc; } - if (fullLogLine.Contains(AT, StringComparison.OrdinalIgnoreCase)) + if (fullLogLine.Span.Contains(AT, StringComparison.OrdinalIgnoreCase)) { - var str = fullLogLine.Trim(); - string className = null; - string lineNum = null; + var str = fullLogLine.Span.Trim(); + + ReadOnlySpan className; + var pos = str.IndexOf(AT, StringComparison.OrdinalIgnoreCase) + 3; str = str[pos..]; // remove 'at ' - var idx = str.IndexOfAny(['(', '$', '<']); + var idx = str.IndexOfAny(_delimiters); - if (idx != -1) + if (idx == -1) { - if (str[idx] == '$') - { - className = str[..idx]; - } - else - { - pos = str.LastIndexOf(DOT, idx, StringComparison.OrdinalIgnoreCase); - if (pos == -1) - { - return null; - } - - className = str[..pos]; - } - - idx = str.LastIndexOf(DOUBLE_DOT, StringComparison.OrdinalIgnoreCase); + return null; + } - if (idx == -1) + if (str[idx] == '$') + { + className = str[..idx]; + } + else + { + pos = str[..idx].LastIndexOf(DOT, StringComparison.OrdinalIgnoreCase); + if (pos == -1) { return null; } - pos = str.IndexOf(')', idx); + className = str[..pos]; + } - if (pos == -1) - { - return null; - } + idx = str.LastIndexOf(DOUBLE_DOT, StringComparison.OrdinalIgnoreCase); + + if (idx == -1) + { + return null; + } - lineNum = str.Substring(idx + 1, pos - idx - 1); + pos = str[idx..].IndexOf(')'); + + if (pos == -1) + { + return null; } + + var lineNum = str.Slice(idx + 1, pos - 1); + /* * @@ -137,7 +146,7 @@ private XmlDocument BuildParam (ILogLine line) } [SupportedOSPlatform("windows")] - private XmlDocument BuildXmlDocument (string className, string lineNum) + private XmlDocument BuildXmlDocument (ReadOnlySpan className, ReadOnlySpan lineNum) { XmlDocument xmlDoc = new(); _ = xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", "yes"); @@ -151,8 +160,8 @@ private XmlDocument BuildXmlDocument (string className, string lineNum) var elemClassName = xmlDoc.CreateElement("classname"); var elemLineNum = xmlDoc.CreateElement("linenumber"); - elemClassName.InnerText = className; - elemLineNum.InnerText = lineNum; + elemClassName.InnerText = className.ToString(); + elemLineNum.InnerText = lineNum.ToString(); _ = loadElement.AppendChild(elemClassName); _ = loadElement.AppendChild(elemLineNum); return xmlDoc; @@ -169,7 +178,7 @@ public string GetMenuText (IList loglines, ILogLineMemoryColumnizer columni } [SupportedOSPlatform("windows")] - public string GetMenuText (int linesCount, ILogLineMemoryColumnizer columnizer, ILogLine logline) + public string GetMenuText (int linesCount, ILogLineMemoryColumnizer columnizer, ILogLineMemory logline) { return linesCount == 1 && BuildParam(logline) != null ? Resources.Eminus_UI_GetMenuText_LoadClassInEclipse @@ -182,7 +191,7 @@ public void MenuSelected (IList loglines, ILogLineMemoryColumnizer columniz } [SupportedOSPlatform("windows")] - public void MenuSelected (int linesCount, ILogLineMemoryColumnizer columnizer, ILogLine logline) + public void MenuSelected (int linesCount, ILogLineMemoryColumnizer columnizer, ILogLineMemory logline) { if (linesCount != 1) { diff --git a/src/LogExpert.UI/Dialogs/FilterSelectorForm.cs b/src/LogExpert.UI/Dialogs/FilterSelectorForm.cs index ea64ca36..c4ae0a5a 100644 --- a/src/LogExpert.UI/Dialogs/FilterSelectorForm.cs +++ b/src/LogExpert.UI/Dialogs/FilterSelectorForm.cs @@ -11,14 +11,14 @@ internal partial class FilterSelectorForm : Form //TODO: Can this be changed to { #region Fields - private readonly ILogLineColumnizerCallback _callback; + private readonly ILogLineMemoryColumnizerCallback _callback; private readonly IList _columnizerList; #endregion #region cTor - public FilterSelectorForm (IList existingColumnizerList, ILogLineMemoryColumnizer currentColumnizer, ILogLineColumnizerCallback callback, IConfigManager configManager) + public FilterSelectorForm (IList existingColumnizerList, ILogLineMemoryColumnizer currentColumnizer, ILogLineMemoryColumnizerCallback callback, IConfigManager configManager) { SuspendLayout(); @@ -108,13 +108,13 @@ private void OnFilterComboBoxSelectedIndexChanged (object sender, EventArgs e) Resources.FilterSelectorForm_UI_Text_SupportsTimeshift_Format, timeshiftSupported); commentTextBox.Text = description; - configButton.Enabled = SelectedColumnizer is IColumnizerConfigurator; + configButton.Enabled = SelectedColumnizer is IColumnizerConfiguratorMemory; } //TODO: Check if this logic can be removed from this class and remove all the config manager instances from here. private void OnConfigButtonClick (object sender, EventArgs e) { - if (SelectedColumnizer is IColumnizerConfigurator configurator) + if (SelectedColumnizer is IColumnizerConfiguratorMemory configurator) { configurator.Configure(_callback, ConfigManager.ActiveConfigDir); IsConfigPressed = true; diff --git a/src/LogExpert.UI/Entities/ArgParser.cs b/src/LogExpert.UI/Entities/ArgParser.cs index fecd7e06..53f2e41f 100644 --- a/src/LogExpert.UI/Entities/ArgParser.cs +++ b/src/LogExpert.UI/Entities/ArgParser.cs @@ -14,7 +14,7 @@ internal class ArgParser (string argTemplate) #region Public methods [SupportedOSPlatform("windows")] - public string BuildArgs (ILogLine logLine, int lineNum, ILogFileInfo logFileInfo, Form parent) + public string BuildArgs (ILogLineMemory logLine, int lineNum, ILogFileInfo logFileInfo, Form parent) { StringBuilder builder = new(argTemplate); @@ -47,7 +47,7 @@ public string BuildArgs (ILogLine logLine, int lineNum, ILogFileInfo logFileInfo replace = GetNextGroup(builder, ref sPos); if (reg != null && replace != null) { - var result = Regex.Replace(logLine.FullLine, reg, replace); + var result = Regex.Replace(logLine.FullLine.ToString(), reg, replace); _ = builder.Insert(sPos, result); } } while (replace != null); diff --git a/src/LogExpert.UI/Interface/ILogPaintContextUI.cs b/src/LogExpert.UI/Interface/ILogPaintContextUI.cs index b95af50d..7462ad82 100644 --- a/src/LogExpert.UI/Interface/ILogPaintContextUI.cs +++ b/src/LogExpert.UI/Interface/ILogPaintContextUI.cs @@ -25,8 +25,6 @@ internal interface ILogPaintContextUI : ILogPaintContext #region Public methods - ILogLine GetLogLine (int lineNum); - ILogLineMemory GetLogLineMemory (int lineNum); IColumnMemory GetCellValue (int rowIndex, int columnIndex); diff --git a/src/LogExpert.sln b/src/LogExpert.sln index eded07ab..43437357 100644 --- a/src/LogExpert.sln +++ b/src/LogExpert.sln @@ -57,6 +57,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SftpFileSystemx86", "SftpFi EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "setup", "setup", "{C625E7C2-AF15-4C40-8C35-3E166D46F939}" ProjectSection(SolutionItems) = preProject + setup\CodeDependencies.iss = setup\CodeDependencies.iss setup\ExtraFunctions.iss = setup\ExtraFunctions.iss setup\LogExpertInstaller.iss = setup\LogExpertInstaller.iss EndProjectSection From 24c4b99c1592f02111c707b75d5173fd7fcbdec2 Mon Sep 17 00:00:00 2001 From: Hirogen Date: Fri, 6 Mar 2026 22:19:53 +0100 Subject: [PATCH 2/6] update interfaces and a few more smaller fixes --- src/AutoColumnizer/AutoColumnizer.cs | 9 +- src/AutoColumnizer/AutoColumnizer.csproj | 1 + .../Extensions/LogLineExtensionsTests.cs | 33 ---- src/ColumnizerLib/Column.cs | 28 --- src/ColumnizerLib/ColumnizedLogLine.cs | 6 - src/ColumnizerLib/Extensions/Extensions.cs | 6 - .../IAutoLogLineColumnizerCallback.cs | 2 +- src/ColumnizerLib/IColumn.cs | 1 + src/ColumnizerLib/IColumnMemory.cs | 8 +- src/ColumnizerLib/IColumnizedLogLine.cs | 1 + src/ColumnizerLib/IColumnizedLogLineMemory.cs | 6 +- src/ColumnizerLib/IColumnizerPriority.cs | 1 + .../IColumnizerPriorityMemory.cs | 2 +- src/ColumnizerLib/IContextMenuEntry.cs | 19 ++ src/ColumnizerLib/ILogExpertCallback.cs | 9 +- src/ColumnizerLib/ILogLine.cs | 1 + src/ColumnizerLib/ILogLineColumnizer.cs | 1 + .../ILogLineColumnizerCallback.cs | 2 +- src/ColumnizerLib/ILogLineMemory.cs | 9 +- src/ColumnizerLib/ILogLineMemoryColumnizer.cs | 57 +++++- .../ILogLineMemoryXmlColumnizer.cs | 17 +- src/ColumnizerLib/ILogLineSpan.cs | 16 +- src/ColumnizerLib/ILogLineSpanColumnizer.cs | 4 +- src/ColumnizerLib/ILogLineXmlColumnizer.cs | 1 + src/ColumnizerLib/ITextValue.cs | 17 +- src/ColumnizerLib/ITextValueMemory.cs | 27 +-- src/ColumnizerLib/ITextValueSpan.cs | 7 +- src/ColumnizerLib/LineEntry.cs | 9 +- src/ColumnizerLib/LogLine.cs | 10 +- src/CsvColumnizer/CsvColumnizer.cs | 44 ----- src/CsvColumnizer/CsvLogLine.cs | 4 - src/GlassfishColumnizer/GlassFishLogLine.cs | 4 - .../GlassfishColumnizer.cs | 49 +---- src/JsonColumnizer/JsonColumnizer.cs | 39 ---- .../JsonCompactColumnizer.cs | 11 +- src/Log4jXmlColumnizer/Log4JLogLine.cs | 4 - src/Log4jXmlColumnizer/Log4jXmlColumnizer.cs | 48 +---- .../Log4jXmlColumnizerConfig.cs | 2 + .../StreamReaderBenchmarks.cs | 2 +- src/LogExpert.Configuration/ConfigManager.cs | 2 +- .../Callback/ColumnizerCallback.cs | 2 +- .../Callback/ColumnizerCallbackMemory.cs | 2 +- .../Classes/Bookmark/BookmarkDataProvider.cs | 2 +- .../Classes/Columnizer/ClfColumnizer.cs | 35 ---- .../Columnizer/SquareBracketColumnizer.cs | 34 ---- .../Classes/Columnizer/TimestampColumnizer.cs | 15 -- .../DateTimeParser/DateFormatPartAdjuster.cs | 21 +-- .../Classes/Filter/FilterCancelHandler.cs | 2 +- .../Classes/Filter/FilterPipe.cs | 2 +- .../Classes/Log/BatchedProgressReporter.cs | 3 +- src/LogExpert.Core/Classes/Log/LogBuffer.cs | 3 - .../Classes/Log/LogStreamReaderBase.cs | 2 +- .../Classes/Log/LogfileReader.cs | 91 +-------- .../Log/PositionAwareStreamReaderBase.cs | 2 - .../Log/PositionAwareStreamReaderChannel.cs | 2 +- .../Log/PositionAwareStreamReaderPipeline.cs | 2 +- .../Log/PositionAwareStreamReaderSystem.cs | 2 +- .../Classes/Log/RolloverFilenameHandler.cs | 3 +- .../Classes/Persister/PersisterHelpers.cs | 2 +- .../Classes/Persister/ProjectFileResolver.cs | 2 +- .../Classes/Persister/ProjectFileValidator.cs | 2 +- .../Classes/Persister/ProjectPersister.cs | 2 +- .../Classes/xml/XmlLogReader.cs | 2 +- src/LogExpert.Core/Config/Settings.cs | 1 - .../Entities/DefaultLogfileColumnizer.cs | 39 +--- .../Entities/FileViewContext.cs | 2 +- src/LogExpert.Core/Entities/SearchParams.cs | 2 +- .../CurrentHighlightGroupChangedEventArgs.cs | 6 +- .../FilterListChangedEventArgs.cs | 3 +- .../EventArguments/LoadFileEventArgs.cs | 4 +- src/LogExpert.Core/Extensions/IEnumerable.cs | 20 +- .../Interface/ILogPaintContext.cs | 5 - .../IBackgroundProcessCancelHandler.cs | 4 +- .../IBookmarkData.cs | 2 +- .../IBookmarkView.cs | 2 +- .../IConfigManager.cs | 2 +- .../IFileViewContext.cs | 4 +- .../ILogExpertProxy.cs | 2 +- .../Interfaces/ILogPaintContext.cs | 5 + .../ILogStreamReader.cs | 2 +- .../ILogStreamReaderMemory.cs | 2 +- .../ILogStreamReaderSpan.cs | 2 +- .../ILogTabWindow.cs | 2 +- .../{Interface => Interfaces}/ILogView.cs | 2 +- .../{Interface => Interfaces}/ILogWindow.cs | 26 +-- .../{Interface => Interfaces}/IPipeline.cs | 2 +- .../IPluginRegistry.cs | 2 +- .../ISharedToolWindow.cs | 2 +- .../ISpanLineReader.cs | 2 +- src/LogExpert.Resources/Resources.Designer.cs | 2 +- src/LogExpert.Resources/Resources.de.resx | 2 +- src/LogExpert.Resources/Resources.resx | 2 +- .../ColumnizerJsonConverterTests.cs | 30 --- src/LogExpert.Tests/ColumnizerPickerTest.cs | 6 - .../ConfigManagerPortableModeTests.cs | 52 +----- .../IPC/ActiveWindowTrackingTests.cs | 2 +- .../IPC/LockInstancePriorityTests.cs | 2 +- .../JsonCompactColumnizerTest.cs | 2 +- src/LogExpert.Tests/ReaderTest.cs | 3 +- .../RolloverFilenameHandlerNullTests.cs | 2 +- .../SquareBracketColumnizerTest.cs | 2 +- .../UI/LogTabWindowResourceTests.cs | 2 +- .../UI/LogTabWindowThreadingTests.cs | 2 +- .../Controls/LogWindow/LogWindow.cs | 15 +- .../LogWindow/TimeSpreadCalculator.cs | 2 +- src/LogExpert.UI/Dialogs/BookmarkWindow.cs | 2 +- .../Dialogs/FilterSelectorForm.cs | 2 +- src/LogExpert.UI/Dialogs/HighlightDialog.cs | 2 +- .../Dialogs/LogTabWindow/LogTabWindow.cs | 4 +- src/LogExpert.UI/Dialogs/PluginTrustDialog.cs | 2 +- src/LogExpert.UI/Dialogs/SearchDialog.cs | 2 +- src/LogExpert.UI/Dialogs/SettingsDialog.cs | 2 +- .../LogWindow/AbstractLogTabWindow.cs | 2 +- .../LogWindow/StaticLogTabWindowData.cs | 2 +- .../Interface/ILogPaintContextUI.cs | 2 +- src/LogExpert.UI/Interface/ITabController.cs | 1 - .../TabControllerService/TabController.cs | 1 - .../WindowClosingEventArgs.cs | 2 +- .../Classes/LogExpertApplicationContext.cs | 2 +- src/LogExpert/Classes/LogExpertProxy.cs | 2 +- src/PluginHashGenerator.Tool/Program.cs | 2 +- .../ArchitecturalTests.cs | 2 +- src/PluginRegistry.Tests/PerformanceTests.cs | 5 +- .../PluginEventBusTests.cs | 174 ++++++++++-------- .../PluginLoadProgressTests.cs | 47 ++--- .../PluginManifestTests.cs | 25 ++- .../PluginPermissionManagerTests.cs | 7 +- .../PluginValidatorTests.cs | 9 +- src/PluginRegistry/PluginRegistry.cs | 2 +- src/RegexColumnizer.UnitTests/TestLogLine.cs | 4 - src/RegexColumnizer/RegexColumnizer.cs | 56 ------ src/Solution Items/AssemblyInfo.cs | 3 +- 132 files changed, 402 insertions(+), 993 deletions(-) delete mode 100644 src/ColumnizerLib.UnitTests/Extensions/LogLineExtensionsTests.cs delete mode 100644 src/LogExpert.Core/Interface/ILogPaintContext.cs rename src/LogExpert.Core/{Interface => Interfaces}/IBackgroundProcessCancelHandler.cs (83%) rename src/LogExpert.Core/{Interface => Interfaces}/IBookmarkData.cs (92%) rename src/LogExpert.Core/{Interface => Interfaces}/IBookmarkView.cs (93%) rename src/LogExpert.Core/{Interface => Interfaces}/IConfigManager.cs (99%) rename src/LogExpert.Core/{Interface => Interfaces}/IFileViewContext.cs (62%) rename src/LogExpert.Core/{Interface => Interfaces}/ILogExpertProxy.cs (97%) create mode 100644 src/LogExpert.Core/Interfaces/ILogPaintContext.cs rename src/LogExpert.Core/{Interface => Interfaces}/ILogStreamReader.cs (99%) rename src/LogExpert.Core/{Interface => Interfaces}/ILogStreamReaderMemory.cs (97%) rename src/LogExpert.Core/{Interface => Interfaces}/ILogStreamReaderSpan.cs (97%) rename src/LogExpert.Core/{Interface => Interfaces}/ILogTabWindow.cs (97%) rename src/LogExpert.Core/{Interface => Interfaces}/ILogView.cs (93%) rename src/LogExpert.Core/{Interface => Interfaces}/ILogWindow.cs (90%) rename src/LogExpert.Core/{Interface => Interfaces}/IPipeline.cs (99%) rename src/LogExpert.Core/{Interface => Interfaces}/IPluginRegistry.cs (85%) rename src/LogExpert.Core/{Interface => Interfaces}/ISharedToolWindow.cs (96%) rename src/LogExpert.Core/{Interface => Interfaces}/ISpanLineReader.cs (75%) diff --git a/src/AutoColumnizer/AutoColumnizer.cs b/src/AutoColumnizer/AutoColumnizer.cs index c831b3e1..4bb349d9 100644 --- a/src/AutoColumnizer/AutoColumnizer.cs +++ b/src/AutoColumnizer/AutoColumnizer.cs @@ -2,7 +2,7 @@ namespace AutoColumnizer; -public class AutoColumnizer : ILogLineColumnizer +public class AutoColumnizer : ILogLineMemoryColumnizer { #region ILogLineColumnizer implementation @@ -28,7 +28,6 @@ public string GetDescription () return "Automatically find the right columnizer for any file"; } - public int GetColumnCount () { throw new NotImplementedException(); @@ -39,7 +38,7 @@ public string[] GetColumnNames () throw new NotImplementedException(); } - public IColumnizedLogLine SplitLine (ILogLineColumnizerCallback callback, ILogLine line) + public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback callback, ILogLineMemory logLine) { throw new NotImplementedException(); } @@ -54,12 +53,12 @@ public int GetTimeOffset () throw new NotImplementedException(); } - public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine line) + public DateTime GetTimestamp (ILogLineMemoryColumnizerCallback callback, ILogLineMemory logLine) { throw new NotImplementedException(); } - public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue) + public void PushValue (ILogLineMemoryColumnizerCallback callback, int column, string value, string oldValue) { } diff --git a/src/AutoColumnizer/AutoColumnizer.csproj b/src/AutoColumnizer/AutoColumnizer.csproj index 8e2b2d9e..b700fe0b 100644 --- a/src/AutoColumnizer/AutoColumnizer.csproj +++ b/src/AutoColumnizer/AutoColumnizer.csproj @@ -4,6 +4,7 @@ AutoColumnizer $(SolutionDir)..\bin\$(Configuration)\plugins + AutoColumnizer diff --git a/src/ColumnizerLib.UnitTests/Extensions/LogLineExtensionsTests.cs b/src/ColumnizerLib.UnitTests/Extensions/LogLineExtensionsTests.cs deleted file mode 100644 index 13fec885..00000000 --- a/src/ColumnizerLib.UnitTests/Extensions/LogLineExtensionsTests.cs +++ /dev/null @@ -1,33 +0,0 @@ -using ColumnizerLib; -using ColumnizerLib.Extensions; - -using NUnit.Framework; - -namespace LogExpert.ColumnizerLib.Tests.Extensions; - -[TestFixture] - -internal class LogLineExtensionsTests -{ - private class TestingLogLine : ILogLine - { - public string FullLine { get; set; } - - public int LineNumber { get; set; } - - public string Text { get; set; } - } - - [Test] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Test")] - public void ToClipBoardText_ReturnsExpected () - { - var underTest = new TestingLogLine - { - FullLine = "a fullLine", - LineNumber = 89, - Text = "a text" - }; - Assert.That(underTest.ToClipBoardText(), Is.EqualTo("\t90\ta fullLine")); - } -} diff --git a/src/ColumnizerLib/Column.cs b/src/ColumnizerLib/Column.cs index 82702862..8b628bdf 100644 --- a/src/ColumnizerLib/Column.cs +++ b/src/ColumnizerLib/Column.cs @@ -41,34 +41,6 @@ static Column () public static IColumnMemory EmptyColumn { get; } - [Obsolete("Use IColumnizedLogLineMemory Parent Property")] - IColumnizedLogLine IColumn.Parent { get; } - - [Obsolete("Use ReadOnlyMemory FullValue")] - string IColumn.FullValue - { - get; - //set - //{ - // field = value; - - // var temp = FullValue.ToString(); - - // foreach (var replacement in _replacements) - // { - // temp = replacement(temp); - // } - - // DisplayValue = temp.AsMemory(); - //} - } - - [Obsolete("Use the DisplayValue property of IColumnMemory")] - string IColumn.DisplayValue { get; } - - [Obsolete("Use Text property of ITextValueMemory")] - string ITextValue.Text => DisplayValue.ToString(); - public IColumnizedLogLineMemory Parent { get; set => field = value; diff --git a/src/ColumnizerLib/ColumnizedLogLine.cs b/src/ColumnizerLib/ColumnizedLogLine.cs index 68c4aa8b..2a9c6e43 100644 --- a/src/ColumnizerLib/ColumnizedLogLine.cs +++ b/src/ColumnizerLib/ColumnizedLogLine.cs @@ -4,12 +4,6 @@ public class ColumnizedLogLine : IColumnizedLogLineMemory { #region Properties - [Obsolete("Use the Property of IColumnizedLogLineMemory")] - ILogLine IColumnizedLogLine.LogLine { get; } - - [Obsolete("Use the Property of IColumnizedLogLineMemory")] - IColumn[] IColumnizedLogLine.ColumnValues { get; } - public ILogLineMemory LogLine { get; set; } public IColumnMemory[] ColumnValues { get; set; } diff --git a/src/ColumnizerLib/Extensions/Extensions.cs b/src/ColumnizerLib/Extensions/Extensions.cs index f0071ee6..1ed80cea 100644 --- a/src/ColumnizerLib/Extensions/Extensions.cs +++ b/src/ColumnizerLib/Extensions/Extensions.cs @@ -1,14 +1,8 @@ namespace ColumnizerLib.Extensions; -[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1708:Identifiers should differ by more than case", Justification = "Intentionally")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1034:Nested types should not be visible", Justification = "Intentionally")] public static class Extensions { - extension(ILogLine logLine) - { - public string ToClipBoardText () => logLine == null ? string.Empty : $"\t{logLine.LineNumber + 1}\t{logLine.FullLine}"; - } - extension(ILogLineMemory logLine) { public string ToClipBoardText () => logLine == null ? string.Empty : $"\t{logLine.LineNumber + 1}\t{logLine.FullLine}"; diff --git a/src/ColumnizerLib/IAutoLogLineColumnizerCallback.cs b/src/ColumnizerLib/IAutoLogLineColumnizerCallback.cs index 7a07c63c..60d7799b 100644 --- a/src/ColumnizerLib/IAutoLogLineColumnizerCallback.cs +++ b/src/ColumnizerLib/IAutoLogLineColumnizerCallback.cs @@ -1,6 +1,6 @@ namespace ColumnizerLib; -[Obsolete("This interface is deprecated. Use IAutoLogLineMemoryColumnizerCallback instead.")] +[Obsolete("This interface is deprecated. Use IAutoLogLineMemoryColumnizerCallback for a memory-based implementation instead.")] public interface IAutoLogLineColumnizerCallback { /// diff --git a/src/ColumnizerLib/IColumn.cs b/src/ColumnizerLib/IColumn.cs index 276e675d..7f97c722 100644 --- a/src/ColumnizerLib/IColumn.cs +++ b/src/ColumnizerLib/IColumn.cs @@ -1,5 +1,6 @@ namespace ColumnizerLib; +[Obsolete("This interface is deprecated. Use IColumnMemory for a memory-based implementation instead.")] public interface IColumn : ITextValue { #region Properties diff --git a/src/ColumnizerLib/IColumnMemory.cs b/src/ColumnizerLib/IColumnMemory.cs index 60dcbae3..dd072e86 100644 --- a/src/ColumnizerLib/IColumnMemory.cs +++ b/src/ColumnizerLib/IColumnMemory.cs @@ -1,14 +1,14 @@ namespace ColumnizerLib; -public interface IColumnMemory : IColumn, ITextValueMemory +public interface IColumnMemory : ITextValueMemory { #region Properties - new IColumnizedLogLineMemory Parent { get; } + IColumnizedLogLineMemory Parent { get; } - new ReadOnlyMemory FullValue { get; } + ReadOnlyMemory FullValue { get; } - new ReadOnlyMemory DisplayValue { get; } + ReadOnlyMemory DisplayValue { get; } #endregion } \ No newline at end of file diff --git a/src/ColumnizerLib/IColumnizedLogLine.cs b/src/ColumnizerLib/IColumnizedLogLine.cs index c4b1904d..785f1463 100644 --- a/src/ColumnizerLib/IColumnizedLogLine.cs +++ b/src/ColumnizerLib/IColumnizedLogLine.cs @@ -1,5 +1,6 @@ namespace ColumnizerLib; +[Obsolete("This interface is deprecated. Use IColumnizedLogLineMemory for a memory-based implementation instead.")] public interface IColumnizedLogLine { #region Properties diff --git a/src/ColumnizerLib/IColumnizedLogLineMemory.cs b/src/ColumnizerLib/IColumnizedLogLineMemory.cs index a0accc34..db183bf4 100644 --- a/src/ColumnizerLib/IColumnizedLogLineMemory.cs +++ b/src/ColumnizerLib/IColumnizedLogLineMemory.cs @@ -1,12 +1,12 @@ namespace ColumnizerLib; -public interface IColumnizedLogLineMemory : IColumnizedLogLine +public interface IColumnizedLogLineMemory { #region Properties - new ILogLineMemory LogLine { get; } + ILogLineMemory LogLine { get; } - new IColumnMemory[] ColumnValues { get; } + IColumnMemory[] ColumnValues { get; } #endregion } \ No newline at end of file diff --git a/src/ColumnizerLib/IColumnizerPriority.cs b/src/ColumnizerLib/IColumnizerPriority.cs index 0638a81c..dce9128b 100644 --- a/src/ColumnizerLib/IColumnizerPriority.cs +++ b/src/ColumnizerLib/IColumnizerPriority.cs @@ -6,6 +6,7 @@ namespace ColumnizerLib; /// Implementations use the provided file name and sample log lines to assess how suitable the columnizer /// is for processing the file. Higher priority values indicate a better fit. This interface is typically used to select /// the most appropriate columnizer when multiple options are available. +[Obsolete("This interface is deprecated. Use IColumnizerPriorityMemory instead for a memory based implementation.")] public interface IColumnizerPriority { /// diff --git a/src/ColumnizerLib/IColumnizerPriorityMemory.cs b/src/ColumnizerLib/IColumnizerPriorityMemory.cs index e67614e9..f5dbb786 100644 --- a/src/ColumnizerLib/IColumnizerPriorityMemory.cs +++ b/src/ColumnizerLib/IColumnizerPriorityMemory.cs @@ -6,7 +6,7 @@ namespace ColumnizerLib; /// Implementations use the provided file name and sample log lines to assess how suitable the columnizer /// is for processing the file. Higher priority values indicate a better fit. This interface is typically used to select /// the most appropriate columnizer when multiple options are available. -public interface IColumnizerPriorityMemory : IColumnizerPriority +public interface IColumnizerPriorityMemory { /// /// Determines the priority level for the specified file based on the provided log line samples. diff --git a/src/ColumnizerLib/IContextMenuEntry.cs b/src/ColumnizerLib/IContextMenuEntry.cs index 05ba1f8e..76775d27 100644 --- a/src/ColumnizerLib/IContextMenuEntry.cs +++ b/src/ColumnizerLib/IContextMenuEntry.cs @@ -32,8 +32,19 @@ public interface IContextMenuEntry ///
  • null: No menu entry is displayed.
  • /// /// + [Obsolete("Use the overload of GetMenuText that takes an ILogLineMemory parameter instead.")] string GetMenuText (IList loglines, ILogLineMemoryColumnizer columnizer, ILogExpertCallback callback); + /// + /// This function is called from LogExpert if the context menu is about to be displayed. + /// Your implementation can control whether LogExpert will show a menu entry by returning + /// an appropriate value.

    + ///
    + /// Throws an exception if any parameter is null or if linesCount is less than 1. + /// The number of lines to include in the generated menu text. Must be a positive integer. + /// An implementation of the ILogLineMemoryColumnizer interface used to format the log line data for display. + /// An instance of ILogLineMemory representing the log line to be included in the menu text. + /// A string containing the formatted menu text based on the provided log line and formatting options. string GetMenuText (int linesCount, ILogLineMemoryColumnizer columnizer, ILogLineMemory logline); @@ -46,8 +57,16 @@ public interface IContextMenuEntry /// if necessary. /// The callback interface implemented by LogExpert. You can use the functions /// for retrieving log lines or pass it along to functions of the Columnizer if needed. + [Obsolete("Use the overload of MenuSelected that takes an ILogLineMemory parameter instead.")] void MenuSelected (IList loglines, ILogLineMemoryColumnizer columnizer, ILogExpertCallback callback); + /// + /// This function is called from LogExpert if the menu entry is choosen by the user.

    + /// Note that this function is called from the GUI thread. So try to avoid time consuming operations. + ///
    + /// + /// + /// void MenuSelected (int linesCount, ILogLineMemoryColumnizer columnizer, ILogLineMemory logline); #endregion diff --git a/src/ColumnizerLib/ILogExpertCallback.cs b/src/ColumnizerLib/ILogExpertCallback.cs index 0caaf36c..b4ec9e78 100644 --- a/src/ColumnizerLib/ILogExpertCallback.cs +++ b/src/ColumnizerLib/ILogExpertCallback.cs @@ -1,11 +1,10 @@ -using System.Collections.Generic; - namespace ColumnizerLib; /// /// This callback interface is implemented by LogExpert. You can use it e.g. when implementing a /// context menu plugin. /// +[Obsolete("This interface is deprecated. Please use ILogExpertCallbackMemory for a memory based implementation instead.")] public interface ILogExpertCallback : ILogLineColumnizerCallback { #region Public methods @@ -27,7 +26,7 @@ public interface ILogExpertCallback : ILogLineColumnizerCallback ///
  • The file will be deleted when closing the tab!
  • /// /// - void AddTempFileTab(string fileName, string title); + void AddTempFileTab (string fileName, string title); /// /// With this function you can create a new tab and add a bunch of text lines to it. @@ -53,13 +52,13 @@ public interface ILogExpertCallback : ILogLineColumnizerCallback /// will disable the "locate in original file" menu entry. /// /// - void AddPipedTab(IList lineEntryList, string title); + void AddPipedTab (IList lineEntryList, string title); /// /// Returns the title of the current tab (the tab for which the context menu plugin was called for). /// /// - string GetTabTitle(); + string GetTabTitle (); #endregion } \ No newline at end of file diff --git a/src/ColumnizerLib/ILogLine.cs b/src/ColumnizerLib/ILogLine.cs index e1125ee2..c6c65226 100644 --- a/src/ColumnizerLib/ILogLine.cs +++ b/src/ColumnizerLib/ILogLine.cs @@ -6,6 +6,7 @@ namespace ColumnizerLib; /// Implementations of this interface provide access to both the full text of the log line and its /// position within the source log. This can be used to correlate log entries with their original context or for /// processing log files line by line. +[Obsolete("This interface is deprecated. Use ILogLineMemory for a memory-based implementation instead.")] public interface ILogLine : ITextValue { #region Properties diff --git a/src/ColumnizerLib/ILogLineColumnizer.cs b/src/ColumnizerLib/ILogLineColumnizer.cs index c42456b8..066e6c13 100644 --- a/src/ColumnizerLib/ILogLineColumnizer.cs +++ b/src/ColumnizerLib/ILogLineColumnizer.cs @@ -11,6 +11,7 @@ namespace ColumnizerLib; ///



    /// You can implement your own columnizers for your logfile format, if needed. ///
    +[Obsolete("This interface is deprecated. Use ILogLineMemoryColumnizer for a memory-based implementation instead.")] public interface ILogLineColumnizer { #region Public methods diff --git a/src/ColumnizerLib/ILogLineColumnizerCallback.cs b/src/ColumnizerLib/ILogLineColumnizerCallback.cs index 845451a3..c288393e 100644 --- a/src/ColumnizerLib/ILogLineColumnizerCallback.cs +++ b/src/ColumnizerLib/ILogLineColumnizerCallback.cs @@ -12,7 +12,7 @@ namespace ColumnizerLib; ///An example would be when the log lines contains only the time of day but the date is coded in the file name. In this situation ///you can use the GetFileName() function to retrieve the name of the current file to build a complete timestamp. /// -[Obsolete("This interface is deprecated and will be removed in a future version. Please use ILogLineMemoryColumnizerCallback instead.")] +[Obsolete("This interface is deprecated and will be removed in a future version. Please use ILogLineMemoryColumnizerCallback for a memory based implementation instead.")] public interface ILogLineColumnizerCallback { #region Public methods diff --git a/src/ColumnizerLib/ILogLineMemory.cs b/src/ColumnizerLib/ILogLineMemory.cs index ce5ebb9d..eddcb745 100644 --- a/src/ColumnizerLib/ILogLineMemory.cs +++ b/src/ColumnizerLib/ILogLineMemory.cs @@ -6,10 +6,15 @@ namespace ColumnizerLib; /// Implementations provide access to the entire log line as a , enabling efficient, /// allocation-free operations on the underlying character data. This is useful for scenarios where high-performance /// parsing or processing of log lines is required. -public interface ILogLineMemory : ILogLine, ITextValueMemory +public interface ILogLineMemory : ITextValueMemory { /// /// Gets the full content of the line as a read-only region of memory. /// - new ReadOnlyMemory FullLine { get; } + ReadOnlyMemory FullLine { get; } + + /// + /// Gets the line number in the source text associated with this element. + /// + int LineNumber { get; } } \ No newline at end of file diff --git a/src/ColumnizerLib/ILogLineMemoryColumnizer.cs b/src/ColumnizerLib/ILogLineMemoryColumnizer.cs index 5593ee73..05985fb5 100644 --- a/src/ColumnizerLib/ILogLineMemoryColumnizer.cs +++ b/src/ColumnizerLib/ILogLineMemoryColumnizer.cs @@ -8,10 +8,65 @@ namespace ColumnizerLib; /// allowing consumers to process log data efficiently in memory. The interface is designed for use with log sources /// that provide direct memory access to log lines, supporting custom column extraction and value notification /// workflows. Thread safety and performance characteristics depend on the specific implementation. -public interface ILogLineMemoryColumnizer : ILogLineColumnizer +public interface ILogLineMemoryColumnizer { #region Public methods + /// + /// Returns the name for the columnizer. This name is used for the columnizer selection dialog. + /// + string GetName (); + + /// + /// Returns the name that is given by the user for this columnizer. + /// + string GetCustomName (); + + /// + /// Returns the description of the columnizer. This text is used in the columnizer selection dialog. + /// + string GetDescription (); + + /// + /// Returns the number of columns the columnizer will split lines into. + /// + /// + /// This value does not include the column for displaying the line number. The line number column + /// is added by LogExpert and is not handled by columnizers. + /// + int GetColumnCount (); + + /// + /// Returns the names of the columns. The returned names are used by LogExpert for the column headers in the data grid view. + /// The names are expected in order from left to right. + /// + string[] GetColumnNames (); + + /// + /// Returns true, if the columnizer supports timeshift handling. + /// + /// + /// If you return true, you also have to implement the function SetTimeOffset(), GetTimeOffset() and GetTimestamp(). + /// You also must handle PushValue() for the column(s) that displays the timestamp. + /// + bool IsTimeshiftImplemented (); + + /// + /// Sets an offset to be used for displaying timestamp values. You have to implement this function, if + /// your IsTimeshiftImplemented() function return true. + /// + /// + /// You have to store the given value in the Columnizer instance and add this offset to the timestamp column(s) returned by SplitLine() + /// (e.g. in the date and time columns). + /// + /// The timestamp offset in milliseconds. + void SetTimeOffset (int msecOffset); + + /// + /// Returns the current stored timestamp offset (set by SetTimeOffset()). + /// + int GetTimeOffset (); + /// /// Splits a log line into columns using the specified callback for columnization. /// diff --git a/src/ColumnizerLib/ILogLineMemoryXmlColumnizer.cs b/src/ColumnizerLib/ILogLineMemoryXmlColumnizer.cs index 5f449c60..ddb1683a 100644 --- a/src/ColumnizerLib/ILogLineMemoryXmlColumnizer.cs +++ b/src/ColumnizerLib/ILogLineMemoryXmlColumnizer.cs @@ -1,8 +1,7 @@ namespace ColumnizerLib; /// -/// This is the interface for a Columnizer which supports XML log files. This interface extends -/// the interface. +/// This is the interface for a Columnizer which supports XML log files. /// LogExpert will automatically load a log file in XML mode if the current Columnizer implements /// this interface. /// @@ -19,14 +18,14 @@ namespace ColumnizerLib; /// /// If you implement a XML Columnizer you have to provide the start tag and end tag and a /// XSLT. Also you have to provide a namespace declaration, if your logfile uses name spaces. -/// All this stuff must be provided by returning a IXmlLogConfiguration in the method. +/// All this stuff must be provided by returning a IXmlLogConfiguration in the method. /// /// /// The processing of XML log files is done in the following steps: ///
      ///
    1. LogExpert reads the file and separates it into fragments of XML content using the given -/// start/end tags ()
    2. -///
    3. The fragments will be translated using the given XSLT () +/// start/end tags ()
    4. +///
    5. The fragments will be translated using the given XSLT () /// The result is one or more lines of text content. These lines will be the lines LogExpert will 'see' /// in its internal buffer and line management. They will be handled like normal text lines in other /// (non-XML) log files. @@ -37,10 +36,16 @@ namespace ColumnizerLib; ///
    ///
    /// -public interface ILogLineMemoryXmlColumnizer : ILogLineXmlColumnizer, ILogLineMemoryColumnizer +public interface ILogLineMemoryXmlColumnizer : ILogLineMemoryColumnizer { #region Public methods + /// + /// You have to implement this function to provide a configuration for LogExpert's XML reader. + /// + /// + IXmlLogConfiguration GetXmlLogConfiguration (); + /// /// Returns the text which should be copied into the clipboard when the user want to copy selected /// lines to clipboard. diff --git a/src/ColumnizerLib/ILogLineSpan.cs b/src/ColumnizerLib/ILogLineSpan.cs index 8c77317c..fed633bb 100644 --- a/src/ColumnizerLib/ILogLineSpan.cs +++ b/src/ColumnizerLib/ILogLineSpan.cs @@ -1,3 +1,5 @@ +namespace ColumnizerLib; + public interface ILogLineSpan { ReadOnlySpan GetFullLineSpan (); @@ -5,19 +7,13 @@ public interface ILogLineSpan int LineNumber { get; } } -public readonly ref struct LogLineSpan : ILogLineSpan +public readonly ref struct LogLineSpan (ReadOnlyMemory lineMemory, int lineNumber) : ILogLineSpan { - private readonly ReadOnlyMemory _lineMemory; - - public LogLineSpan (ReadOnlyMemory lineMemory, int lineNumber) - { - _lineMemory = lineMemory; - LineNumber = lineNumber; - } + private readonly ReadOnlyMemory _lineMemory = lineMemory; - public static LogLineSpan Create (ReadOnlyMemory lineMemory, int lineNumber) => new LogLineSpan(lineMemory, lineNumber); + public static LogLineSpan Create (ReadOnlyMemory lineMemory, int lineNumber) => new(lineMemory, lineNumber); public ReadOnlySpan GetFullLineSpan () => _lineMemory.Span; - public int LineNumber { get; } + public int LineNumber { get; } = lineNumber; } \ No newline at end of file diff --git a/src/ColumnizerLib/ILogLineSpanColumnizer.cs b/src/ColumnizerLib/ILogLineSpanColumnizer.cs index 0f460327..440f77d2 100644 --- a/src/ColumnizerLib/ILogLineSpanColumnizer.cs +++ b/src/ColumnizerLib/ILogLineSpanColumnizer.cs @@ -5,12 +5,12 @@ public interface ILogLineSpanColumnizer : ILogLineMemoryColumnizer /// /// Span-based version of SplitLine that avoids string allocations /// - IColumnizedLogLineMemory SplitLine (ILogLineColumnizerCallback callback, ReadOnlySpan lineSpan, int lineNumber); + IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback callback, ReadOnlySpan lineSpan, int lineNumber); /// /// Span-based timestamp extraction /// - DateTime GetTimestamp (ILogLineColumnizerCallback callback, ReadOnlySpan lineSpan, int lineNumber); + DateTime GetTimestamp (ILogLineMemoryColumnizerCallback callback, ReadOnlySpan lineSpan, int lineNumber); /// /// Indicates if this columnizer supports span-based operations diff --git a/src/ColumnizerLib/ILogLineXmlColumnizer.cs b/src/ColumnizerLib/ILogLineXmlColumnizer.cs index 00aead04..8f63aa73 100644 --- a/src/ColumnizerLib/ILogLineXmlColumnizer.cs +++ b/src/ColumnizerLib/ILogLineXmlColumnizer.cs @@ -37,6 +37,7 @@ namespace ColumnizerLib; /// /// /// +[Obsolete("This interface is deprecated. Please use ILogLineMemoryXmlColumnizer for a memory based implementation instead.")] public interface ILogLineXmlColumnizer : ILogLineColumnizer { #region Public methods diff --git a/src/ColumnizerLib/ITextValue.cs b/src/ColumnizerLib/ITextValue.cs index d11cfcf7..c68a740c 100644 --- a/src/ColumnizerLib/ITextValue.cs +++ b/src/ColumnizerLib/ITextValue.cs @@ -5,7 +5,7 @@ namespace ColumnizerLib; /// /// This interface is deprecated and maintained only for backward compatibility. Use direct access to /// FullLine or FullValue properties instead of relying on this interface. -[Obsolete("ITextValue is deprecated. Access FullLine or FullValue directly instead.", false)] +[Obsolete("ITextValue is deprecated. ITextValueMemory for a memory based implementation", false)] public interface ITextValue { #region Properties @@ -13,22 +13,7 @@ public interface ITextValue /// /// Gets the text content associated with this instance. /// - [Obsolete("Use FullLine or FullValue properties directly instead of this property.")] string Text { get; } #endregion -} - -/// -/// Provides extension methods for retrieving text representations from log line and column memory objects. -/// -/// These extension methods are obsolete. Use the corresponding properties on the target interfaces or -/// classes directly instead of these methods. -public static class TextValueExtensions -{ - [Obsolete("Use ILogLine.FullLine property directly instead of this extension method")] - public static string GetText (this ILogLine logLine) => logLine.FullLine; - - [Obsolete("Use DisplayValue property directly")] - public static string GetText (this IColumn column) => column.DisplayValue; } \ No newline at end of file diff --git a/src/ColumnizerLib/ITextValueMemory.cs b/src/ColumnizerLib/ITextValueMemory.cs index f110d022..ab356a3a 100644 --- a/src/ColumnizerLib/ITextValueMemory.cs +++ b/src/ColumnizerLib/ITextValueMemory.cs @@ -3,37 +3,14 @@ namespace ColumnizerLib; /// /// Represents a text value that exposes its underlying memory as a read-only span of characters. /// -/// This interface extends to provide direct access to the underlying character -/// memory, enabling efficient operations without additional string allocations. Implementations may use this to support -/// high-performance text processing scenarios. -public interface ITextValueMemory : ITextValue +public interface ITextValueMemory { #region Properties /// /// Gets the text content as a read-only region of memory. /// - new ReadOnlyMemory Text { get; } + ReadOnlyMemory Text { get; } #endregion -} - -/// -/// Provides extension methods for retrieving the textual content from log line and column memory representations. -/// -public static class TextValueMemoryExtensions -{ - /// - /// Gets the full text content of the specified log line as a read-only memory region. - /// - /// The log line from which to retrieve the text content. Cannot be null. - /// A read-only memory region containing the characters of the entire log line. - public static ReadOnlyMemory GetText (this ILogLineMemory logLine) => logLine.FullLine; - - /// - /// Gets the display text of the column as a read-only block of memory. - /// - /// The column from which to retrieve the display text. Cannot be null. - /// A read-only memory region containing the display text of the specified column. - public static ReadOnlyMemory GetText (this IColumnMemory column) => column.DisplayValue; } \ No newline at end of file diff --git a/src/ColumnizerLib/ITextValueSpan.cs b/src/ColumnizerLib/ITextValueSpan.cs index f7800b15..7cc46ccd 100644 --- a/src/ColumnizerLib/ITextValueSpan.cs +++ b/src/ColumnizerLib/ITextValueSpan.cs @@ -1,8 +1,6 @@ namespace ColumnizerLib; -// DEPRECATED: This interface adds no value and causes performance overhead. -// Keep for backward compatibility but mark as obsolete. -[Obsolete("ITextValue is deprecated. Access FullLine or FullValue directly instead.", false)] +[Obsolete("ITextValue is deprecated. ITextValueMemory for a memory based implementation instead.", false)] public interface ITextValueSpan { #region Properties @@ -12,11 +10,10 @@ public interface ITextValueSpan #endregion } +[Obsolete("TextValueSpanExtensions is deprecated. ITextValueMemory for a memory based implementation instead.", false)] public static class TextValueSpanExtensions { - [Obsolete("Use ILogLine.FullLine property directly instead of this extension method")] public static string GetText (this ILogLine logLine) => logLine.FullLine; - [Obsolete("Use DisplayValue property directly")] public static string GetText (this IColumn column) => column.DisplayValue; } \ No newline at end of file diff --git a/src/ColumnizerLib/LineEntry.cs b/src/ColumnizerLib/LineEntry.cs index f37bfd67..e112b227 100644 --- a/src/ColumnizerLib/LineEntry.cs +++ b/src/ColumnizerLib/LineEntry.cs @@ -1,5 +1,3 @@ -using System; - namespace ColumnizerLib; /// @@ -7,6 +5,7 @@ namespace ColumnizerLib; /// This struct is used by . /// /// +[Obsolete("This struct is not used anymore. It will be removed in a future version. Use the LineEntryMemory for a memory based implementation.")] public struct LineEntry : IEquatable { /// @@ -19,17 +18,17 @@ public struct LineEntry : IEquatable /// public int LineNum { get; set; } - public override bool Equals(object obj) + public override bool Equals (object obj) { return obj is LineEntry other && Equals(other); } - public readonly bool Equals(LineEntry other) + public readonly bool Equals (LineEntry other) { return LineNum == other.LineNum && Equals(LogLine, other.LogLine); } - public override readonly int GetHashCode() + public override readonly int GetHashCode () { return HashCode.Combine(LineNum, LogLine); } diff --git a/src/ColumnizerLib/LogLine.cs b/src/ColumnizerLib/LogLine.cs index ddaf68a7..5f7a9fd4 100644 --- a/src/ColumnizerLib/LogLine.cs +++ b/src/ColumnizerLib/LogLine.cs @@ -11,12 +11,12 @@ namespace ColumnizerLib; /// /// /// Usage:
    -/// This struct implements the interface, allowing it to be used wherever an ILogLine +/// This struct implements the interface, allowing it to be used wherever an ILogLineMemory /// is expected. It provides value semantics and is intended to be lightweight and efficiently passed by value. ///
    /// -/// Relationship to ILogLine:
    -/// LogLine is a concrete, immutable implementation of the interface, providing +/// Relationship to ILogLineMemory:
    +/// LogLine is a concrete, immutable implementation of the interface, providing /// properties for the full line text and its line number. ///
    /// @@ -29,12 +29,8 @@ namespace ColumnizerLib; /// public class LogLine : ILogLineMemory { - string ILogLine.FullLine { get; } - public int LineNumber { get; } - string ITextValue.Text { get; } - public ReadOnlyMemory FullLine { get; } public ReadOnlyMemory Text { get; } diff --git a/src/CsvColumnizer/CsvColumnizer.cs b/src/CsvColumnizer/CsvColumnizer.cs index 1d475c46..4e3639e8 100644 --- a/src/CsvColumnizer/CsvColumnizer.cs +++ b/src/CsvColumnizer/CsvColumnizer.cs @@ -128,11 +128,6 @@ public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback call : CreateColumnizedLogLine(logLine); } - public IColumnizedLogLine SplitLine (ILogLineColumnizerCallback callback, ILogLine logLine) - { - return SplitLine(callback as ILogLineMemoryColumnizerCallback, logLine as ILogLineMemory); - } - private static ColumnizedLogLine CreateColumnizedLogLine (ILogLineMemory line) { ColumnizedLogLine cLogLine = new() @@ -159,31 +154,16 @@ public int GetTimeOffset () throw new NotImplementedException(); } - public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine logLine) - { - throw new NotImplementedException(); - } - public DateTime GetTimestamp (ILogLineMemoryColumnizerCallback callback, ILogLineMemory logLine) { throw new NotImplementedException(); } - public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue) - { - throw new NotImplementedException(); - } - public void PushValue (ILogLineMemoryColumnizerCallback callback, int column, string value, string oldValue) { throw new NotImplementedException(); } - public void Selected (ILogLineColumnizerCallback callback) - { - Selected(callback as ILogLineMemoryColumnizerCallback); - } - public void Selected (ILogLineMemoryColumnizerCallback callback) { ArgumentNullException.ThrowIfNull(callback, nameof(callback)); @@ -228,16 +208,6 @@ public void DeSelected (ILogLineMemoryColumnizerCallback callback) // nothing to do } - public void DeSelected (ILogLineColumnizerCallback callback) - { - // nothing to do - } - - public void Configure (ILogLineColumnizerCallback callback, string configDir) - { - Configure(callback as ILogLineMemoryColumnizerCallback, configDir); - } - public void Configure (ILogLineMemoryColumnizerCallback callback, string configDir) { var configPath = configDir + "\\" + CONFIGFILENAME; @@ -295,20 +265,6 @@ NotSupportedException or } } - public Priority GetPriority (string fileName, IEnumerable samples) - { - ArgumentException.ThrowIfNullOrWhiteSpace(fileName, nameof(fileName)); - - var result = Priority.NotSupport; - - if (fileName.EndsWith("csv", StringComparison.OrdinalIgnoreCase)) - { - result = Priority.CanSupport; - } - - return result; - } - public Priority GetPriority (string fileName, IEnumerable samples) { ArgumentException.ThrowIfNullOrWhiteSpace(fileName, nameof(fileName)); diff --git a/src/CsvColumnizer/CsvLogLine.cs b/src/CsvColumnizer/CsvLogLine.cs index 7ac81b5a..9090c7b0 100644 --- a/src/CsvColumnizer/CsvLogLine.cs +++ b/src/CsvColumnizer/CsvLogLine.cs @@ -7,10 +7,6 @@ public class CsvLogLine (string fullLine, int lineNumber) : ILogLineMemory { #region Properties - string ILogLine.FullLine { get; } - - string ITextValue.Text => FullLine.ToString(); - public ReadOnlyMemory FullLine { get; } = fullLine.AsMemory(); public ReadOnlyMemory Text { get; } diff --git a/src/GlassfishColumnizer/GlassFishLogLine.cs b/src/GlassfishColumnizer/GlassFishLogLine.cs index dc1a9963..0a3229d5 100644 --- a/src/GlassfishColumnizer/GlassFishLogLine.cs +++ b/src/GlassfishColumnizer/GlassFishLogLine.cs @@ -11,11 +11,7 @@ internal class GlassFishLogLine (ReadOnlyMemory fullLine, ReadOnlyMemory Text { get; } = text; - string ILogLine.FullLine { get; } - public int LineNumber { get; set; } = lineNumber; - string ITextValue.Text => FullLine.ToString(); - #endregion } \ No newline at end of file diff --git a/src/GlassfishColumnizer/GlassfishColumnizer.cs b/src/GlassfishColumnizer/GlassfishColumnizer.cs index bfcce04e..46df4e83 100644 --- a/src/GlassfishColumnizer/GlassfishColumnizer.cs +++ b/src/GlassfishColumnizer/GlassfishColumnizer.cs @@ -43,11 +43,6 @@ public IXmlLogConfiguration GetXmlLogConfiguration () return _xmlConfig; } - public ILogLine GetLineTextForClipboard (ILogLine logLine, ILogLineColumnizerCallback callback) - { - return GetLineTextForClipboard(logLine as ILogLineMemory, callback as ILogLineMemoryColumnizerCallback); - } - public string GetName () { return "Glassfish"; @@ -87,17 +82,6 @@ public ILogLineMemory GetLineTextForClipboard (ILogLineMemory logLine, ILogLineM return new GlassFishLogLine(ReplaceInMemory(logLine.FullLine, SEPARATOR_CHAR, '|'), logLine.Text, logLine.LineNumber); } - /// - /// Splits the specified log line into columns using the provided columnizer callback. - /// - /// The callback interface used to provide columnization logic for the log line. Cannot be null. - /// The log line to be split into columns. Cannot be null. - /// An object representing the columnized version of the log line. - public IColumnizedLogLine SplitLine (ILogLineColumnizerCallback callback, ILogLine line) - { - return SplitLine(callback as ILogLineMemoryColumnizerCallback, line as ILogLineMemory); - } - /// /// Parses a log line into its constituent columns according to the columnizer's format. /// @@ -105,11 +89,11 @@ public IColumnizedLogLine SplitLine (ILogLineColumnizerCallback callback, ILogLi /// message column is populated and date/time columns are left blank. The method is tolerant of malformed input and /// will not throw for common formatting issues. /// A callback interface used to provide context or services required during columnization. - /// The log line to be split into columns. + /// The log line to be split into columns. /// An object representing the columnized log line, with each column populated based on the input line. If the line /// does not match the expected format, the entire line is placed in the log message column. [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Intentionally passed")] - public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback callback, ILogLineMemory line) + public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback callback, ILogLineMemory logLine) { //[#|2025-03-14T10:36:37.159846Z|INFO|glassfish|javax.enterprise.system.core.server|_ThreadID=14;_ThreadName=main;| GlassFish Server Open Source Edition 5.1.0 (5.1.0) startup time : milliseconds 987 |#] //[#|2008-08-24T08:58:38.325+0200|INFO|sun-appserver9.1|STC.eWay.batch.com.stc.connector.batchadapter.system.BatchInboundWork|_ThreadID=43;_ThreadName=p: thread-pool-1; w: 7;|BATCH-MSG-M0992: Another Work item already checking for files... |#] @@ -118,12 +102,12 @@ public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback call ColumnizedLogLine cLogLine = new() { - LogLine = line + LogLine = logLine }; var columns = Column.CreateColumns(COLUMN_COUNT, cLogLine); - var temp = line.FullLine; + var temp = logLine.FullLine; // delete '[#|' and '|#]' if (temp.Span.StartsWith("[#|", StringComparison.OrdinalIgnoreCase)) @@ -147,7 +131,7 @@ public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback call try { - var dateTime = GetTimestamp(callback, line); + var dateTime = GetTimestamp(callback, logLine); if (dateTime == DateTime.MinValue) { columns[1].FullValue = temp; @@ -225,29 +209,6 @@ public int GetTimeOffset () return _timeOffset; } - /// - /// Retrieves the timestamp associated with the specified log line. - /// - /// An object that provides callback methods for columnizing log lines. Cannot be null. - /// The log line from which to extract the timestamp. Cannot be null. - /// A DateTime value representing the timestamp of the specified log line. - public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine logLine) - { - return GetTimestamp(callback as ILogLineMemoryColumnizerCallback, logLine as ILogLineMemory); - } - - /// - /// Pushes a new value for a specified column using the provided callback interface. - /// - /// The callback interface used to handle the value push operation. Cannot be null. - /// The zero-based index of the column to which the value is pushed. - /// The new value to be pushed for the specified column. Can be null. - /// The previous value of the specified column. Can be null. - public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue) - { - PushValue(callback as ILogLineMemoryColumnizerCallback, column, value, oldValue); - } - /// /// Extracts the timestamp from the specified log line using the expected GlassFish log format. /// diff --git a/src/JsonColumnizer/JsonColumnizer.cs b/src/JsonColumnizer/JsonColumnizer.cs index 3800ed8f..7eda8ccb 100644 --- a/src/JsonColumnizer/JsonColumnizer.cs +++ b/src/JsonColumnizer/JsonColumnizer.cs @@ -22,16 +22,6 @@ public partial class JsonColumnizer : ILogLineMemoryColumnizer, IInitColumnizerM #region Public methods - public virtual void Selected (ILogLineColumnizerCallback callback) - { - Selected(callback as ILogLineMemoryColumnizerCallback); - } - - public virtual void DeSelected (ILogLineColumnizerCallback callback) - { - // nothing to do - } - public virtual string GetName () { return "JSON Columnizer"; @@ -59,11 +49,6 @@ public virtual string[] GetColumnNames () return names; } - public virtual IColumnizedLogLine SplitLine (ILogLineColumnizerCallback callback, ILogLine logLine) - { - return SplitLine(callback as ILogLineMemoryColumnizerCallback, logLine as ILogLineMemory); - } - public virtual bool IsTimeshiftImplemented () { return false; @@ -79,30 +64,6 @@ public virtual int GetTimeOffset () throw new NotImplementedException(); } - public virtual DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine logLine) - { - throw new NotImplementedException(); - } - - public virtual void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue) - { - throw new NotImplementedException(); - } - - public virtual Priority GetPriority (string fileName, IEnumerable samples) - { - ArgumentNullException.ThrowIfNull(fileName, nameof(fileName)); - ArgumentNullException.ThrowIfNull(samples, nameof(samples)); - - var result = Priority.NotSupport; - if (fileName.EndsWith("json", StringComparison.OrdinalIgnoreCase)) - { - result = Priority.WellSupport; - } - - return result; - } - #endregion #region Private Methods diff --git a/src/JsonCompactColumnizer/JsonCompactColumnizer.cs b/src/JsonCompactColumnizer/JsonCompactColumnizer.cs index 866cf131..d3db9474 100644 --- a/src/JsonCompactColumnizer/JsonCompactColumnizer.cs +++ b/src/JsonCompactColumnizer/JsonCompactColumnizer.cs @@ -23,11 +23,6 @@ public override string GetDescription () return Resources.JsonCompactColumnizer_Description; } - public override void Selected (ILogLineColumnizerCallback callback) - { - Selected(callback as ILogLineMemoryColumnizerCallback); - } - public override void Selected (ILogLineMemoryColumnizerCallback callback) { ColumnList.Clear(); @@ -39,11 +34,7 @@ public override void Selected (ILogLineMemoryColumnizerCallback callback) } } - public override Priority GetPriority (string fileName, IEnumerable samples) - { - return GetPriority(fileName, samples.Select(line => (ILogLineMemory)line)); - } - + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Intentionally Ignored")] public override Priority GetPriority (string fileName, IEnumerable samples) { ArgumentException.ThrowIfNullOrEmpty(fileName, nameof(fileName)); diff --git a/src/Log4jXmlColumnizer/Log4JLogLine.cs b/src/Log4jXmlColumnizer/Log4JLogLine.cs index 6f135586..9d40eb3a 100644 --- a/src/Log4jXmlColumnizer/Log4JLogLine.cs +++ b/src/Log4jXmlColumnizer/Log4JLogLine.cs @@ -12,9 +12,5 @@ internal class Log4JLogLine (ReadOnlyMemory fullLine, ReadOnlyMemory public ReadOnlyMemory Text { get; } = text; - string ITextValue.Text => FullLine.ToString(); - - string ILogLine.FullLine { get; } - #endregion } \ No newline at end of file diff --git a/src/Log4jXmlColumnizer/Log4jXmlColumnizer.cs b/src/Log4jXmlColumnizer/Log4jXmlColumnizer.cs index 876eecaf..ecec912b 100644 --- a/src/Log4jXmlColumnizer/Log4jXmlColumnizer.cs +++ b/src/Log4jXmlColumnizer/Log4jXmlColumnizer.cs @@ -43,11 +43,6 @@ public IXmlLogConfiguration GetXmlLogConfiguration () return _xmlConfig; } - public ILogLine GetLineTextForClipboard (ILogLine logLine, ILogLineColumnizerCallback callback) - { - return GetLineTextForClipboard(logLine as ILogLineMemory, callback as ILogLineMemoryColumnizerCallback); - } - public ILogLineMemory GetLineTextForClipboard (ILogLineMemory logLine, ILogLineMemoryColumnizerCallback callback) { ArgumentNullException.ThrowIfNull(logLine); @@ -78,39 +73,34 @@ public string[] GetColumnNames () return _config.ActiveColumnNames; } - public IColumnizedLogLine SplitLine (ILogLineColumnizerCallback callback, ILogLine line) - { - return SplitLine(callback as ILogLineMemoryColumnizerCallback, line as ILogLineMemory); - } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Intentionally passed")] - public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback callback, ILogLineMemory line) + public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback callback, ILogLineMemory logLine) { - ArgumentNullException.ThrowIfNull(line); + ArgumentNullException.ThrowIfNull(logLine); ArgumentNullException.ThrowIfNull(callback); ColumnizedLogLine clogLine = new() { - LogLine = line + LogLine = logLine }; var columns = Column.CreateColumns(COLUMN_COUNT, clogLine); // If the line is too short (i.e. does not follow the format for this columnizer) return the whole line content // in colum 8 (the log message column). Date and time column will be left blank. - if (line.FullLine.Length < 15) + if (logLine.FullLine.Length < 15) { - columns[8].FullValue = line.FullLine; + columns[8].FullValue = logLine.FullLine; } else { try { - var dateTime = GetTimestamp(callback, line); + var dateTime = GetTimestamp(callback, logLine); if (dateTime == DateTime.MinValue) { - columns[8].FullValue = line.FullLine; + columns[8].FullValue = logLine.FullLine; } var newDate = dateTime.ToString(DATETIME_FORMAT, CultureInfo.InvariantCulture); @@ -126,7 +116,7 @@ FormatException or var timestmp = columns[0]; ReadOnlyMemory[] cols; - cols = SplitMemory(line.FullLine, trimChars[0], COLUMN_COUNT); + cols = SplitMemory(logLine.FullLine, trimChars[0], COLUMN_COUNT); if (cols.Length != COLUMN_COUNT) { @@ -138,7 +128,7 @@ FormatException or columns[5].FullValue = ReadOnlyMemory.Empty; columns[6].FullValue = ReadOnlyMemory.Empty; columns[7].FullValue = ReadOnlyMemory.Empty; - columns[8].FullValue = line.FullLine; + columns[8].FullValue = logLine.FullLine; } else { @@ -173,11 +163,6 @@ public int GetTimeOffset () return _timeOffset; } - public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine logLine) - { - return GetTimestamp(callback as ILogLineMemoryColumnizerCallback, logLine as ILogLineMemory); - } - public DateTime GetTimestamp (ILogLineMemoryColumnizerCallback callback, ILogLineMemory logLine) { ArgumentNullException.ThrowIfNull(logLine); @@ -227,11 +212,6 @@ public DateTime GetTimestamp (ILogLineMemoryColumnizerCallback callback, ILogLin } } - public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue) - { - PushValue(callback as ILogLineMemoryColumnizerCallback, column, value, oldValue); - } - public void PushValue (ILogLineMemoryColumnizerCallback callback, int column, string value, string oldValue) { if (column == 0) @@ -264,11 +244,6 @@ public void Configure (ILogLineMemoryColumnizerCallback callback, string configD } } - public void Configure (ILogLineColumnizerCallback callback, string configDir) - { - Configure(callback as ILogLineMemoryColumnizerCallback, configDir); - } - public void LoadConfig (string configDir) { var configPath = Path.Join(configDir, "log4jxmlcolumnizer.json"); @@ -298,11 +273,6 @@ public void LoadConfig (string configDir) } } - public Priority GetPriority (string fileName, IEnumerable samples) - { - return GetPriority(fileName, samples.Select(line => (ILogLineMemory)line)); - } - public Priority GetPriority (string fileName, IEnumerable samples) { ArgumentNullException.ThrowIfNull(fileName); diff --git a/src/Log4jXmlColumnizer/Log4jXmlColumnizerConfig.cs b/src/Log4jXmlColumnizer/Log4jXmlColumnizerConfig.cs index 6c769924..80fce6f7 100644 --- a/src/Log4jXmlColumnizer/Log4jXmlColumnizerConfig.cs +++ b/src/Log4jXmlColumnizer/Log4jXmlColumnizerConfig.cs @@ -66,6 +66,8 @@ public string[] ActiveColumnNames public void FillDefaults (string[] columnNames) { + ArgumentNullException.ThrowIfNull(columnNames, nameof(columnNames)); + ColumnList.Clear(); for (var i = 0; i < columnNames.Length; ++i) { diff --git a/src/LogExpert.Benchmarks/StreamReaderBenchmarks.cs b/src/LogExpert.Benchmarks/StreamReaderBenchmarks.cs index 37bc3638..c8a0b382 100644 --- a/src/LogExpert.Benchmarks/StreamReaderBenchmarks.cs +++ b/src/LogExpert.Benchmarks/StreamReaderBenchmarks.cs @@ -5,7 +5,7 @@ using LogExpert.Core.Classes.Log; using LogExpert.Core.Entities; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Benchmarks; diff --git a/src/LogExpert.Configuration/ConfigManager.cs b/src/LogExpert.Configuration/ConfigManager.cs index b21c7494..17815577 100644 --- a/src/LogExpert.Configuration/ConfigManager.cs +++ b/src/LogExpert.Configuration/ConfigManager.cs @@ -10,7 +10,7 @@ using LogExpert.Core.Config; using LogExpert.Core.Entities; using LogExpert.Core.EventArguments; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using Newtonsoft.Json; diff --git a/src/LogExpert.Core/Callback/ColumnizerCallback.cs b/src/LogExpert.Core/Callback/ColumnizerCallback.cs index 25302049..ae9adc2c 100644 --- a/src/LogExpert.Core/Callback/ColumnizerCallback.cs +++ b/src/LogExpert.Core/Callback/ColumnizerCallback.cs @@ -1,6 +1,6 @@ using ColumnizerLib; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.Callback; diff --git a/src/LogExpert.Core/Callback/ColumnizerCallbackMemory.cs b/src/LogExpert.Core/Callback/ColumnizerCallbackMemory.cs index 03c95d46..887a5f05 100644 --- a/src/LogExpert.Core/Callback/ColumnizerCallbackMemory.cs +++ b/src/LogExpert.Core/Callback/ColumnizerCallbackMemory.cs @@ -1,6 +1,6 @@ using ColumnizerLib; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.Callback; diff --git a/src/LogExpert.Core/Classes/Bookmark/BookmarkDataProvider.cs b/src/LogExpert.Core/Classes/Bookmark/BookmarkDataProvider.cs index 6c7de2c4..16656ffd 100644 --- a/src/LogExpert.Core/Classes/Bookmark/BookmarkDataProvider.cs +++ b/src/LogExpert.Core/Classes/Bookmark/BookmarkDataProvider.cs @@ -1,7 +1,7 @@ using System.Globalization; using LogExpert.Core.Entities; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using NLog; diff --git a/src/LogExpert.Core/Classes/Columnizer/ClfColumnizer.cs b/src/LogExpert.Core/Classes/Columnizer/ClfColumnizer.cs index 60b66296..3d299940 100644 --- a/src/LogExpert.Core/Classes/Columnizer/ClfColumnizer.cs +++ b/src/LogExpert.Core/Classes/Columnizer/ClfColumnizer.cs @@ -44,29 +44,6 @@ public int GetTimeOffset () return _timeOffset; } - /// - /// Retrieves the timestamp associated with the specified log line. - /// - /// An object that provides callback methods for columnizing log lines. Cannot be null. - /// The log line from which to extract the timestamp. Cannot be null. - /// A DateTime value representing the timestamp of the specified log line. - public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine logLine) - { - return GetTimestamp(callback as ILogLineMemoryColumnizerCallback, logLine as ILogLineMemory); - } - - /// - /// Notifies the specified callback of a value change for a given column. - /// - /// The callback to be notified of the value change. Cannot be null. - /// The zero-based index of the column for which the value is being updated. - /// The new value to assign to the specified column. - /// The previous value of the specified column before the update. - public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue) - { - PushValue(callback as ILogLineMemoryColumnizerCallback, column, value, oldValue); - } - public string GetName () { return "Webserver CLF Columnizer"; @@ -87,18 +64,6 @@ public string[] GetColumnNames () return ["IP", "User", "Date/Time", "Request", "Status", "Bytes", "Referrer", "User agent"]; } - /// - /// Splits the specified log line into columns using the provided columnizer callback. - /// - /// The callback interface used to receive columnization results and context during the split operation. Cannot be - /// null. - /// The log line to be split into columns. Cannot be null. - /// An object representing the columnized version of the log line. - public IColumnizedLogLine SplitLine (ILogLineColumnizerCallback callback, ILogLine logLine) - { - return SplitLine(callback as ILogLineMemoryColumnizerCallback, logLine as ILogLineMemory); - } - /// /// Extracts the timestamp from the specified log line using the provided callback. /// diff --git a/src/LogExpert.Core/Classes/Columnizer/SquareBracketColumnizer.cs b/src/LogExpert.Core/Classes/Columnizer/SquareBracketColumnizer.cs index 335518e7..dce092c9 100644 --- a/src/LogExpert.Core/Classes/Columnizer/SquareBracketColumnizer.cs +++ b/src/LogExpert.Core/Classes/Columnizer/SquareBracketColumnizer.cs @@ -109,29 +109,6 @@ FormatException or } } - /// - /// Retrieves the timestamp associated with the specified log line. - /// - /// An object that provides callback methods for columnizing log lines. Cannot be null. - /// The log line from which to extract the timestamp. Cannot be null. - /// A DateTime value representing the timestamp of the specified log line. - public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine logLine) - { - return GetTimestamp(callback as ILogLineMemoryColumnizerCallback, logLine as ILogLineMemory); - } - - /// - /// Pushes a new value for a specified column using the provided callback interface. - /// - /// The callback interface used to handle the value push operation. Cannot be null. - /// The zero-based index of the column for which the value is being pushed. - /// The new value to assign to the specified column. Can be null. - /// The previous value of the specified column. Can be null. - public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue) - { - PushValue(callback as ILogLineMemoryColumnizerCallback, column, value, oldValue); - } - public string GetName () { return "Square Bracket Columnizer"; @@ -278,17 +255,6 @@ FormatException or return clogLine; } - /// - /// Splits the specified log line into columns using the provided columnizer callback. - /// - /// The callback interface used to process and retrieve column data from the log line. Cannot be null. - /// The log line to be split into columns. Cannot be null. - /// An object representing the columnized log line, containing the extracted columns from the input line. - public IColumnizedLogLine SplitLine (ILogLineColumnizerCallback callback, ILogLine line) - { - return SplitLine(callback as ILogLineMemoryColumnizerCallback, line as ILogLineMemory); - } - /// /// Splits a log line into an array of columns based on date, time, and bracketed field positions. /// diff --git a/src/LogExpert.Core/Classes/Columnizer/TimestampColumnizer.cs b/src/LogExpert.Core/Classes/Columnizer/TimestampColumnizer.cs index bb980c37..f8a3bb55 100644 --- a/src/LogExpert.Core/Classes/Columnizer/TimestampColumnizer.cs +++ b/src/LogExpert.Core/Classes/Columnizer/TimestampColumnizer.cs @@ -24,16 +24,6 @@ public int GetTimeOffset () return _timeOffset; } - public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine logLine) - { - return GetTimestamp(callback as ILogLineMemoryColumnizerCallback, logLine as ILogLineMemory); - } - - public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue) - { - PushValue(callback as ILogLineMemoryColumnizerCallback, column, value, oldValue); - } - public string GetName () { return "Timestamp Columnizer"; @@ -56,11 +46,6 @@ public string[] GetColumnNames () return ["Date", "Time", "Message"]; } - public IColumnizedLogLine SplitLine (ILogLineColumnizerCallback callback, ILogLine logLine) - { - return SplitLine(callback as ILogLineMemoryColumnizerCallback, logLine as ILogLineMemory); - } - /// /// Determines the priority level for processing a log file based on the presence of recognizable timestamp formats /// in the provided log lines. diff --git a/src/LogExpert.Core/Classes/DateTimeParser/DateFormatPartAdjuster.cs b/src/LogExpert.Core/Classes/DateTimeParser/DateFormatPartAdjuster.cs index 9c85f936..0aa7cfc4 100644 --- a/src/LogExpert.Core/Classes/DateTimeParser/DateFormatPartAdjuster.cs +++ b/src/LogExpert.Core/Classes/DateTimeParser/DateFormatPartAdjuster.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; - namespace LogExpert.Core.Classes.DateTimeParser; //TODO: This should be moved into LogExpert.UI and changed to internal @@ -17,22 +14,12 @@ public static class DateFormatPartAdjuster ["s"] = "ss" }; - public static string AdjustDateTimeFormatPart(string part) + public static string AdjustDateTimeFormatPart (string part) { ArgumentNullException.ThrowIfNull(part, nameof(part)); - if (!_dateTimePartReplacements.TryGetValue(part, out var adjustedPart)) - { - return part; - } - - if (char.IsUpper(part[0])) - { - return adjustedPart.ToUpper(); - } - else - { - return adjustedPart.ToLower(); - } + return !_dateTimePartReplacements.TryGetValue(part, out var adjustedPart) + ? part + : char.IsUpper(part[0]) ? adjustedPart.ToUpperInvariant() : adjustedPart.ToLowerInvariant(); } } \ No newline at end of file diff --git a/src/LogExpert.Core/Classes/Filter/FilterCancelHandler.cs b/src/LogExpert.Core/Classes/Filter/FilterCancelHandler.cs index 14eea0d3..f146cf3d 100644 --- a/src/LogExpert.Core/Classes/Filter/FilterCancelHandler.cs +++ b/src/LogExpert.Core/Classes/Filter/FilterCancelHandler.cs @@ -1,6 +1,6 @@ using System.Globalization; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using NLog; diff --git a/src/LogExpert.Core/Classes/Filter/FilterPipe.cs b/src/LogExpert.Core/Classes/Filter/FilterPipe.cs index a1867dcf..04a57a6f 100644 --- a/src/LogExpert.Core/Classes/Filter/FilterPipe.cs +++ b/src/LogExpert.Core/Classes/Filter/FilterPipe.cs @@ -3,7 +3,7 @@ using ColumnizerLib; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using NLog; diff --git a/src/LogExpert.Core/Classes/Log/BatchedProgressReporter.cs b/src/LogExpert.Core/Classes/Log/BatchedProgressReporter.cs index 01c0bd45..03d711bb 100644 --- a/src/LogExpert.Core/Classes/Log/BatchedProgressReporter.cs +++ b/src/LogExpert.Core/Classes/Log/BatchedProgressReporter.cs @@ -8,10 +8,11 @@ namespace LogExpert.Core.Classes.Log; /// Batches progress updates to reduce UI thread marshalling overhead. /// Collects updates in a thread-safe queue and processes them on a timer. /// +//TODO Refactor public sealed class BatchedProgressReporter : IDisposable { private readonly ConcurrentQueue _progressQueue = new(); - private readonly System.Threading.Timer _timer; + private readonly Timer _timer; private readonly Action _progressCallback; private readonly int _updateIntervalMs; private bool _disposed; diff --git a/src/LogExpert.Core/Classes/Log/LogBuffer.cs b/src/LogExpert.Core/Classes/Log/LogBuffer.cs index 2f9d05ca..b189e7b9 100644 --- a/src/LogExpert.Core/Classes/Log/LogBuffer.cs +++ b/src/LogExpert.Core/Classes/Log/LogBuffer.cs @@ -16,7 +16,6 @@ public class LogBuffer private readonly List _lineList = []; - private readonly IList _logLines = []; private int MAX_LINES = 500; private long _size; @@ -86,14 +85,12 @@ public void AddLine (ILogLineMemory lineMemory, long filePos) public void ClearLines () { - _logLines.Clear(); _lineList.Clear(); LineCount = 0; } public void DisposeContent () { - _logLines.Clear(); _lineList.Clear(); IsDisposed = true; #if DEBUG diff --git a/src/LogExpert.Core/Classes/Log/LogStreamReaderBase.cs b/src/LogExpert.Core/Classes/Log/LogStreamReaderBase.cs index 666afcba..745a706a 100644 --- a/src/LogExpert.Core/Classes/Log/LogStreamReaderBase.cs +++ b/src/LogExpert.Core/Classes/Log/LogStreamReaderBase.cs @@ -1,6 +1,6 @@ using System.Text; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.Classes.Log; diff --git a/src/LogExpert.Core/Classes/Log/LogfileReader.cs b/src/LogExpert.Core/Classes/Log/LogfileReader.cs index ffc2aff3..d1c778b3 100644 --- a/src/LogExpert.Core/Classes/Log/LogfileReader.cs +++ b/src/LogExpert.Core/Classes/Log/LogfileReader.cs @@ -7,7 +7,7 @@ using LogExpert.Core.Entities; using LogExpert.Core.Enums; using LogExpert.Core.EventArguments; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using NLog; @@ -539,41 +539,6 @@ public ILogLineMemory GetLogLineMemory (int lineNum) /// /// line to retrieve /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Constants always UpperCase")] - public async Task GetLogLineWithWait (int lineNum) - { - const int WAIT_TIME = 1000; - - ILogLine result = null; - - if (!_isFastFailOnGetLogLine) - { - var task = Task.Run(() => GetLogLineInternal(lineNum)); - if (task.Wait(WAIT_TIME)) - { - result = task.Result; - _isFastFailOnGetLogLine = false; - } - else - { - _isFastFailOnGetLogLine = true; - _logger.Debug(CultureInfo.InvariantCulture, "No result after {0}ms. Returning .", WAIT_TIME); - } - } - else - { - _logger.Debug(CultureInfo.InvariantCulture, "Fast failing GetLogLine()"); - if (!_isFailModeCheckCallPending) - { - _isFailModeCheckCallPending = true; - var logLine = await GetLogLineInternal(lineNum).ConfigureAwait(true); - GetLineFinishedCallback(logLine); - } - } - - return result; - } - public async Task GetLogLineMemoryWithWait (int lineNum) { ILogLineMemory result = null; @@ -953,44 +918,6 @@ private ILogFileInfo AddFile (string fileName) /// The zero-based line number of the log entry to retrieve. /// A task that represents the asynchronous operation. The task result contains the log line at the specified line /// number, or null if the file is deleted or the line does not exist. - private Task GetLogLineInternal (int lineNum) - { - if (_isDeleted) - { - _logger.Debug(CultureInfo.InvariantCulture, "Returning null for line {0} because file is deleted.", lineNum); - // fast fail if dead file was detected. Prevents repeated lags in GUI thread caused by callbacks from control (e.g. repaint) - return null; - } - - AcquireBufferListReaderLock(); - var logBuffer = GetBufferForLine(lineNum); - if (logBuffer == null) - { - ReleaseBufferListReaderLock(); - _logger.Error("Cannot find buffer for line {0}, file: {1}{2}", lineNum, _fileName, IsMultiFile ? " (MultiFile)" : ""); - return null; - } - - // disposeLock prevents that the garbage collector is disposing just in the moment we use the buffer - AcquireDisposeLockUpgradableReadLock(); - if (logBuffer.IsDisposed) - { - UpgradeDisposeLockToWriterLock(); - lock (logBuffer.FileInfo) - { - ReReadBuffer(logBuffer); - } - - DowngradeDisposeLockFromWriterLock(); - } - - var line = logBuffer.GetLineMemoryOfBlock(lineNum - logBuffer.StartLine); - ReleaseDisposeUpgradeableReadLock(); - ReleaseBufferListReaderLock(); - - return Task.FromResult(line); - } - private Task GetLogLineMemoryInternal (int lineNum) { if (_isDeleted) @@ -1729,22 +1656,6 @@ private LogBuffer GetBufferForLine (int lineNum) return logBuffer; } - /// - /// Handles the completion of a log line retrieval operation and updates internal state flags accordingly. - /// - /// The log line that was retrieved. Can be null if the operation did not return a line. - private void GetLineFinishedCallback (ILogLine line) - { - _isFailModeCheckCallPending = false; - if (line != null) - { - _logger.Debug(CultureInfo.InvariantCulture, "'isFastFailOnGetLogLine' flag was reset"); - _isFastFailOnGetLogLine = false; - } - - _logger.Debug(CultureInfo.InvariantCulture, "'isLogLineCallPending' flag was reset."); - } - private void GetLineMemoryFinishedCallback (ILogLineMemory line) { _isFailModeCheckCallPending = false; diff --git a/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderBase.cs b/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderBase.cs index bfb53aa0..666a8606 100644 --- a/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderBase.cs +++ b/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderBase.cs @@ -143,8 +143,6 @@ public override unsafe int ReadChar () } } - - protected virtual void ResetReader () { _reader.DiscardBufferedData(); diff --git a/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderChannel.cs b/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderChannel.cs index 9478f9ca..1acc7120 100644 --- a/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderChannel.cs +++ b/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderChannel.cs @@ -5,7 +5,7 @@ using System.Threading.Channels; using LogExpert.Core.Entities; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.Classes.Log; diff --git a/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderPipeline.cs b/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderPipeline.cs index 66b09533..deff3ff1 100644 --- a/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderPipeline.cs +++ b/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderPipeline.cs @@ -4,7 +4,7 @@ using System.Text; using LogExpert.Core.Entities; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.Classes.Log; diff --git a/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderSystem.cs b/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderSystem.cs index a1b4e95b..14f32a3d 100644 --- a/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderSystem.cs +++ b/src/LogExpert.Core/Classes/Log/PositionAwareStreamReaderSystem.cs @@ -1,7 +1,7 @@ using System.Text; using LogExpert.Core.Entities; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.Classes.Log; diff --git a/src/LogExpert.Core/Classes/Log/RolloverFilenameHandler.cs b/src/LogExpert.Core/Classes/Log/RolloverFilenameHandler.cs index 9bd42d9a..1c4fe52c 100644 --- a/src/LogExpert.Core/Classes/Log/RolloverFilenameHandler.cs +++ b/src/LogExpert.Core/Classes/Log/RolloverFilenameHandler.cs @@ -1,7 +1,8 @@ using ColumnizerLib; using LogExpert.Core.Entities; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; + using System.Collections.Generic; namespace LogExpert.Core.Classes.Log; diff --git a/src/LogExpert.Core/Classes/Persister/PersisterHelpers.cs b/src/LogExpert.Core/Classes/Persister/PersisterHelpers.cs index 9e7b9942..24f7894c 100644 --- a/src/LogExpert.Core/Classes/Persister/PersisterHelpers.cs +++ b/src/LogExpert.Core/Classes/Persister/PersisterHelpers.cs @@ -1,6 +1,6 @@ using System.Collections.ObjectModel; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.Classes.Persister; diff --git a/src/LogExpert.Core/Classes/Persister/ProjectFileResolver.cs b/src/LogExpert.Core/Classes/Persister/ProjectFileResolver.cs index d089cfe8..8ae60bba 100644 --- a/src/LogExpert.Core/Classes/Persister/ProjectFileResolver.cs +++ b/src/LogExpert.Core/Classes/Persister/ProjectFileResolver.cs @@ -1,6 +1,6 @@ using System.Collections.ObjectModel; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.Classes.Persister; diff --git a/src/LogExpert.Core/Classes/Persister/ProjectFileValidator.cs b/src/LogExpert.Core/Classes/Persister/ProjectFileValidator.cs index 5de26370..dd8ebd0f 100644 --- a/src/LogExpert.Core/Classes/Persister/ProjectFileValidator.cs +++ b/src/LogExpert.Core/Classes/Persister/ProjectFileValidator.cs @@ -1,6 +1,6 @@ using System.Security; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.Classes.Persister; diff --git a/src/LogExpert.Core/Classes/Persister/ProjectPersister.cs b/src/LogExpert.Core/Classes/Persister/ProjectPersister.cs index 8a0c3da5..877c6280 100644 --- a/src/LogExpert.Core/Classes/Persister/ProjectPersister.cs +++ b/src/LogExpert.Core/Classes/Persister/ProjectPersister.cs @@ -1,6 +1,6 @@ using System.Text; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using Newtonsoft.Json; diff --git a/src/LogExpert.Core/Classes/xml/XmlLogReader.cs b/src/LogExpert.Core/Classes/xml/XmlLogReader.cs index 86a9bdc9..b279dc86 100644 --- a/src/LogExpert.Core/Classes/xml/XmlLogReader.cs +++ b/src/LogExpert.Core/Classes/xml/XmlLogReader.cs @@ -1,7 +1,7 @@ using System.Text; using LogExpert.Core.Classes.Log; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.Classes.xml; diff --git a/src/LogExpert.Core/Config/Settings.cs b/src/LogExpert.Core/Config/Settings.cs index 990f5389..73988b4d 100644 --- a/src/LogExpert.Core/Config/Settings.cs +++ b/src/LogExpert.Core/Config/Settings.cs @@ -3,7 +3,6 @@ using LogExpert.Core.Classes.Filter; using LogExpert.Core.Classes.Highlight; using LogExpert.Core.Entities; -using LogExpert.Entities; namespace LogExpert.Core.Config; diff --git a/src/LogExpert.Core/Entities/DefaultLogfileColumnizer.cs b/src/LogExpert.Core/Entities/DefaultLogfileColumnizer.cs index 264e04cd..c64a8417 100644 --- a/src/LogExpert.Core/Entities/DefaultLogfileColumnizer.cs +++ b/src/LogExpert.Core/Entities/DefaultLogfileColumnizer.cs @@ -26,41 +26,27 @@ public string[] GetColumnNames () return ["Text"]; } - /// - /// Splits the specified log line into columns using the provided callback. - /// - /// An object that provides callback methods for columnizing the log line. May be used to customize or influence the - /// columnization process. - /// The log line to be split into columns. Cannot be null. - /// An object representing the columnized version of the specified log line. - public IColumnizedLogLine SplitLine (ILogLineColumnizerCallback callback, ILogLine line) - { - ArgumentNullException.ThrowIfNull(line); - - return SplitLine(callback as ILogLineMemoryColumnizerCallback, line as ILogLineMemory); - } - /// /// Splits the specified log line into columns using the provided callback. /// /// A callback interface that can be used to customize or influence the columnization process. May be null if no /// callback behavior is required. - /// The log line to be split into columns. Cannot be null. + /// The log line to be split into columns. Cannot be null. /// An object representing the columnized version of the specified log line. - public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback callback, ILogLineMemory line) + public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback callback, ILogLineMemory logLine) { - ArgumentNullException.ThrowIfNull(line); + ArgumentNullException.ThrowIfNull(logLine); ColumnizedLogLine cLogLine = new() { - LogLine = line + LogLine = logLine }; cLogLine.ColumnValues = [ new Column { - FullValue = line.FullLine, + FullValue = logLine.FullLine, Parent = cLogLine } ]; @@ -68,7 +54,7 @@ public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback call return cLogLine; } - public DateTime GetTimestamp (ILogLineMemoryColumnizerCallback callback, ILogLineMemory line) + public DateTime GetTimestamp (ILogLineMemoryColumnizerCallback callback, ILogLineMemory logLine) { // No special handling needed for default columnizer return DateTime.MinValue; @@ -81,7 +67,7 @@ public void PushValue (ILogLineMemoryColumnizerCallback callback, int column, st public string Text => GetName(); - public static Priority GetPriority (string fileName, IEnumerable samples) + public static Priority GetPriority (string fileName, IEnumerable samples) { ArgumentNullException.ThrowIfNull(fileName, nameof(fileName)); ArgumentNullException.ThrowIfNull(samples, nameof(samples)); @@ -108,17 +94,6 @@ public int GetTimeOffset () return int.MinValue; } - public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine line) - { - // No special handling needed for default columnizer - return DateTime.MinValue; - } - - public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue) - { - // No special handling needed for default columnizer - } - public string GetCustomName () { return GetName(); diff --git a/src/LogExpert.Core/Entities/FileViewContext.cs b/src/LogExpert.Core/Entities/FileViewContext.cs index 8cc0a27a..b6b57879 100644 --- a/src/LogExpert.Core/Entities/FileViewContext.cs +++ b/src/LogExpert.Core/Entities/FileViewContext.cs @@ -1,4 +1,4 @@ -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.Entities; diff --git a/src/LogExpert.Core/Entities/SearchParams.cs b/src/LogExpert.Core/Entities/SearchParams.cs index 2a5167db..f7f98846 100644 --- a/src/LogExpert.Core/Entities/SearchParams.cs +++ b/src/LogExpert.Core/Entities/SearchParams.cs @@ -1,4 +1,4 @@ -namespace LogExpert.Entities; +namespace LogExpert.Core.Entities; [Serializable] public class SearchParams diff --git a/src/LogExpert.Core/EventArguments/CurrentHighlightGroupChangedEventArgs.cs b/src/LogExpert.Core/EventArguments/CurrentHighlightGroupChangedEventArgs.cs index 7633e06c..650c7bff 100644 --- a/src/LogExpert.Core/EventArguments/CurrentHighlightGroupChangedEventArgs.cs +++ b/src/LogExpert.Core/EventArguments/CurrentHighlightGroupChangedEventArgs.cs @@ -1,9 +1,9 @@ -using LogExpert.Core.Entities; -using LogExpert.Core.Interface; +using LogExpert.Core.Entities; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.EventArguments; -public class CurrentHighlightGroupChangedEventArgs(ILogWindow logWindow, HighlightGroup currentGroup) +public class CurrentHighlightGroupChangedEventArgs (ILogWindow logWindow, HighlightGroup currentGroup) : EventArgs { #region Properties diff --git a/src/LogExpert.Core/EventArguments/FilterListChangedEventArgs.cs b/src/LogExpert.Core/EventArguments/FilterListChangedEventArgs.cs index 0512997a..b2de97c7 100644 --- a/src/LogExpert.Core/EventArguments/FilterListChangedEventArgs.cs +++ b/src/LogExpert.Core/EventArguments/FilterListChangedEventArgs.cs @@ -1,5 +1,4 @@ - -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Core.EventArguments; diff --git a/src/LogExpert.Core/EventArguments/LoadFileEventArgs.cs b/src/LogExpert.Core/EventArguments/LoadFileEventArgs.cs index b7daa31a..68c1e154 100644 --- a/src/LogExpert.Core/EventArguments/LoadFileEventArgs.cs +++ b/src/LogExpert.Core/EventArguments/LoadFileEventArgs.cs @@ -1,3 +1,3 @@ -namespace LogExpert.Core.EventArguments; +namespace LogExpert.Core.EventArguments; -public record LoadFileEventArgs(string FileName, long ReadPos, bool Finished, long FileSize, bool NewFile); \ No newline at end of file +public record LoadFileEventArgs (string FileName, long ReadPos, bool Finished, long FileSize, bool NewFile); \ No newline at end of file diff --git a/src/LogExpert.Core/Extensions/IEnumerable.cs b/src/LogExpert.Core/Extensions/IEnumerable.cs index d8357fb4..64dfdb24 100644 --- a/src/LogExpert.Core/Extensions/IEnumerable.cs +++ b/src/LogExpert.Core/Extensions/IEnumerable.cs @@ -1,24 +1,14 @@ -namespace LogExpert.Core.Extensions; +namespace LogExpert.Core.Extensions; public static class Extensions { - public static bool IsEmpty(this IEnumerable collection) + public static bool IsEmpty (this IEnumerable collection) { - if (collection == null) - { - return true; - } - - return !collection.Any(); + return collection == null || !collection.Any(); } - public static bool IsEmpty(this IList list) + public static bool IsEmpty (this IList list) { - if (list == null) - { - return true; - } - - return list.Count == 0; + return list == null || list.Count == 0; } } \ No newline at end of file diff --git a/src/LogExpert.Core/Interface/ILogPaintContext.cs b/src/LogExpert.Core/Interface/ILogPaintContext.cs deleted file mode 100644 index 2cf7ad03..00000000 --- a/src/LogExpert.Core/Interface/ILogPaintContext.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace LogExpert.Core.Interface; - -public interface ILogPaintContext -{ -} \ No newline at end of file diff --git a/src/LogExpert.Core/Interface/IBackgroundProcessCancelHandler.cs b/src/LogExpert.Core/Interfaces/IBackgroundProcessCancelHandler.cs similarity index 83% rename from src/LogExpert.Core/Interface/IBackgroundProcessCancelHandler.cs rename to src/LogExpert.Core/Interfaces/IBackgroundProcessCancelHandler.cs index b1a0ce37..4aa79c97 100644 --- a/src/LogExpert.Core/Interface/IBackgroundProcessCancelHandler.cs +++ b/src/LogExpert.Core/Interfaces/IBackgroundProcessCancelHandler.cs @@ -1,4 +1,4 @@ -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; /// /// Interface which can register at the LogWindow to be informed of pressing ESC. @@ -11,7 +11,7 @@ public interface IBackgroundProcessCancelHandler /// /// Called when ESC was pressed. /// - void EscapePressed(); + void EscapePressed (); #endregion } \ No newline at end of file diff --git a/src/LogExpert.Core/Interface/IBookmarkData.cs b/src/LogExpert.Core/Interfaces/IBookmarkData.cs similarity index 92% rename from src/LogExpert.Core/Interface/IBookmarkData.cs rename to src/LogExpert.Core/Interfaces/IBookmarkData.cs index 7abcedb7..3d7afcc6 100644 --- a/src/LogExpert.Core/Interface/IBookmarkData.cs +++ b/src/LogExpert.Core/Interfaces/IBookmarkData.cs @@ -1,6 +1,6 @@ using LogExpert.Core.Entities; -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; public interface IBookmarkData { diff --git a/src/LogExpert.Core/Interface/IBookmarkView.cs b/src/LogExpert.Core/Interfaces/IBookmarkView.cs similarity index 93% rename from src/LogExpert.Core/Interface/IBookmarkView.cs rename to src/LogExpert.Core/Interfaces/IBookmarkView.cs index 963c7c41..ba15f9ef 100644 --- a/src/LogExpert.Core/Interface/IBookmarkView.cs +++ b/src/LogExpert.Core/Interfaces/IBookmarkView.cs @@ -1,6 +1,6 @@ using LogExpert.Core.Entities; -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; /// /// To be implemented by the bookmark window. Will be informed from LogWindow about changes in bookmarks. diff --git a/src/LogExpert.Core/Interface/IConfigManager.cs b/src/LogExpert.Core/Interfaces/IConfigManager.cs similarity index 99% rename from src/LogExpert.Core/Interface/IConfigManager.cs rename to src/LogExpert.Core/Interfaces/IConfigManager.cs index f5b9408e..ac523daf 100644 --- a/src/LogExpert.Core/Interface/IConfigManager.cs +++ b/src/LogExpert.Core/Interfaces/IConfigManager.cs @@ -3,7 +3,7 @@ using LogExpert.Core.Config; using LogExpert.Core.EventArguments; -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; /// /// Manages application configuration settings including loading, saving, importing, and exporting. diff --git a/src/LogExpert.Core/Interface/IFileViewContext.cs b/src/LogExpert.Core/Interfaces/IFileViewContext.cs similarity index 62% rename from src/LogExpert.Core/Interface/IFileViewContext.cs rename to src/LogExpert.Core/Interfaces/IFileViewContext.cs index 15ae41b2..25d5dcc6 100644 --- a/src/LogExpert.Core/Interface/IFileViewContext.cs +++ b/src/LogExpert.Core/Interfaces/IFileViewContext.cs @@ -1,6 +1,6 @@ -using LogExpert.Core.Entities; +using LogExpert.Core.Entities; -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; public interface IFileViewContext { diff --git a/src/LogExpert.Core/Interface/ILogExpertProxy.cs b/src/LogExpert.Core/Interfaces/ILogExpertProxy.cs similarity index 97% rename from src/LogExpert.Core/Interface/ILogExpertProxy.cs rename to src/LogExpert.Core/Interfaces/ILogExpertProxy.cs index 39c9c48a..14a96a62 100644 --- a/src/LogExpert.Core/Interface/ILogExpertProxy.cs +++ b/src/LogExpert.Core/Interfaces/ILogExpertProxy.cs @@ -1,4 +1,4 @@ -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; public interface ILogExpertProxy { diff --git a/src/LogExpert.Core/Interfaces/ILogPaintContext.cs b/src/LogExpert.Core/Interfaces/ILogPaintContext.cs new file mode 100644 index 00000000..8d96e829 --- /dev/null +++ b/src/LogExpert.Core/Interfaces/ILogPaintContext.cs @@ -0,0 +1,5 @@ +namespace LogExpert.Core.Interfaces; + +public interface ILogPaintContext +{ +} \ No newline at end of file diff --git a/src/LogExpert.Core/Interface/ILogStreamReader.cs b/src/LogExpert.Core/Interfaces/ILogStreamReader.cs similarity index 99% rename from src/LogExpert.Core/Interface/ILogStreamReader.cs rename to src/LogExpert.Core/Interfaces/ILogStreamReader.cs index bc57cc4f..b5782d67 100644 --- a/src/LogExpert.Core/Interface/ILogStreamReader.cs +++ b/src/LogExpert.Core/Interfaces/ILogStreamReader.cs @@ -1,6 +1,6 @@ using System.Text; -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; /// /// Provides a position-aware stream reader interface for reading log files with support for character encoding diff --git a/src/LogExpert.Core/Interface/ILogStreamReaderMemory.cs b/src/LogExpert.Core/Interfaces/ILogStreamReaderMemory.cs similarity index 97% rename from src/LogExpert.Core/Interface/ILogStreamReaderMemory.cs rename to src/LogExpert.Core/Interfaces/ILogStreamReaderMemory.cs index 7da602c8..4cd90053 100644 --- a/src/LogExpert.Core/Interface/ILogStreamReaderMemory.cs +++ b/src/LogExpert.Core/Interfaces/ILogStreamReaderMemory.cs @@ -1,4 +1,4 @@ -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; public interface ILogStreamReaderMemory : ILogStreamReader { diff --git a/src/LogExpert.Core/Interface/ILogStreamReaderSpan.cs b/src/LogExpert.Core/Interfaces/ILogStreamReaderSpan.cs similarity index 97% rename from src/LogExpert.Core/Interface/ILogStreamReaderSpan.cs rename to src/LogExpert.Core/Interfaces/ILogStreamReaderSpan.cs index 6f844c98..96761c29 100644 --- a/src/LogExpert.Core/Interface/ILogStreamReaderSpan.cs +++ b/src/LogExpert.Core/Interfaces/ILogStreamReaderSpan.cs @@ -1,4 +1,4 @@ -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; public interface ILogStreamReaderSpan : ILogStreamReader { diff --git a/src/LogExpert.Core/Interface/ILogTabWindow.cs b/src/LogExpert.Core/Interfaces/ILogTabWindow.cs similarity index 97% rename from src/LogExpert.Core/Interface/ILogTabWindow.cs rename to src/LogExpert.Core/Interfaces/ILogTabWindow.cs index 7b71d10f..d2cee26e 100644 --- a/src/LogExpert.Core/Interface/ILogTabWindow.cs +++ b/src/LogExpert.Core/Interfaces/ILogTabWindow.cs @@ -1,4 +1,4 @@ -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; /// /// Represents a log tab window that can display and manage log files. diff --git a/src/LogExpert.Core/Interface/ILogView.cs b/src/LogExpert.Core/Interfaces/ILogView.cs similarity index 93% rename from src/LogExpert.Core/Interface/ILogView.cs rename to src/LogExpert.Core/Interfaces/ILogView.cs index 8427d0f1..8315fb53 100644 --- a/src/LogExpert.Core/Interface/ILogView.cs +++ b/src/LogExpert.Core/Interfaces/ILogView.cs @@ -1,6 +1,6 @@ using ColumnizerLib; -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; /// /// Methods to control the LogWindow from other views. diff --git a/src/LogExpert.Core/Interface/ILogWindow.cs b/src/LogExpert.Core/Interfaces/ILogWindow.cs similarity index 90% rename from src/LogExpert.Core/Interface/ILogWindow.cs rename to src/LogExpert.Core/Interfaces/ILogWindow.cs index fa80ef9c..83b800ef 100644 --- a/src/LogExpert.Core/Interface/ILogWindow.cs +++ b/src/LogExpert.Core/Interfaces/ILogWindow.cs @@ -3,7 +3,7 @@ using LogExpert.Core.Classes.Log; using LogExpert.Core.Classes.Persister; -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; /// /// Represents a log window that displays and manages a log file in LogExpert. @@ -29,30 +29,6 @@ public interface ILogWindow /// string GetCurrentFileName (int lineNum); - - /// - /// Gets the log line at the specified line number asynchronously, with a timeout. - /// - /// The zero-based line number to retrieve. - /// - /// An object containing the line content and metadata, - /// or null if the operation times out or the line cannot be retrieved. - /// - /// - /// - /// This method waits for up to 1 second for the line to be loaded. If the line - /// is not available within that time, it returns null. This prevents - /// the GUI thread from freezing when files are slow to load (e.g., from network shares - /// or when files have been deleted). - /// - /// - /// After detecting a timeout, the method enters a 'fast fail mode' where subsequent - /// calls return null immediately. A background operation checks if the issue - /// is resolved and exits fast fail mode when the file becomes accessible again. - /// - /// - ILogLine GetLogLineWithWait (int lineNum); - /// /// Retrieves the memory representation of a log line at the specified line number. /// diff --git a/src/LogExpert.Core/Interface/IPipeline.cs b/src/LogExpert.Core/Interfaces/IPipeline.cs similarity index 99% rename from src/LogExpert.Core/Interface/IPipeline.cs rename to src/LogExpert.Core/Interfaces/IPipeline.cs index 8258e9f1..77517209 100644 --- a/src/LogExpert.Core/Interface/IPipeline.cs +++ b/src/LogExpert.Core/Interfaces/IPipeline.cs @@ -1,6 +1,6 @@ using System.Collections.Concurrent; -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; public interface IPipeline { diff --git a/src/LogExpert.Core/Interface/IPluginRegistry.cs b/src/LogExpert.Core/Interfaces/IPluginRegistry.cs similarity index 85% rename from src/LogExpert.Core/Interface/IPluginRegistry.cs rename to src/LogExpert.Core/Interfaces/IPluginRegistry.cs index 51484a1a..a0fe388e 100644 --- a/src/LogExpert.Core/Interface/IPluginRegistry.cs +++ b/src/LogExpert.Core/Interfaces/IPluginRegistry.cs @@ -1,6 +1,6 @@ using ColumnizerLib; -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; //TODO: Add documentation public interface IPluginRegistry diff --git a/src/LogExpert.Core/Interface/ISharedToolWindow.cs b/src/LogExpert.Core/Interfaces/ISharedToolWindow.cs similarity index 96% rename from src/LogExpert.Core/Interface/ISharedToolWindow.cs rename to src/LogExpert.Core/Interfaces/ISharedToolWindow.cs index 211a20d8..101b4da5 100644 --- a/src/LogExpert.Core/Interface/ISharedToolWindow.cs +++ b/src/LogExpert.Core/Interfaces/ISharedToolWindow.cs @@ -2,7 +2,7 @@ using LogExpert.Core.Config; -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; /// /// Interface to be implemented by tools windows that are shared across multiple log files. diff --git a/src/LogExpert.Core/Interface/ISpanLineReader.cs b/src/LogExpert.Core/Interfaces/ISpanLineReader.cs similarity index 75% rename from src/LogExpert.Core/Interface/ISpanLineReader.cs rename to src/LogExpert.Core/Interfaces/ISpanLineReader.cs index adb10a4f..b6b15f47 100644 --- a/src/LogExpert.Core/Interface/ISpanLineReader.cs +++ b/src/LogExpert.Core/Interfaces/ISpanLineReader.cs @@ -1,4 +1,4 @@ -namespace LogExpert.Core.Interface; +namespace LogExpert.Core.Interfaces; public interface ISpanLineReader { diff --git a/src/LogExpert.Resources/Resources.Designer.cs b/src/LogExpert.Resources/Resources.Designer.cs index 66df7fb7..419c3aeb 100644 --- a/src/LogExpert.Resources/Resources.Designer.cs +++ b/src/LogExpert.Resources/Resources.Designer.cs @@ -1380,7 +1380,7 @@ public static string LogExpert_Common_Error_5Parameters_ErrorDuring0Value1Min2Ma } /// - /// Looks up a localized string similar to Insufficient rights {0}: {1} . + /// Looks up a localized string similar to Insufficient rights {0}: {1}. /// public static string LogExpert_Common_Error_InsufficientRights_For_Parameter_ErrorMessage { get { diff --git a/src/LogExpert.Resources/Resources.de.resx b/src/LogExpert.Resources/Resources.de.resx index cf75f9f4..351aae19 100644 --- a/src/LogExpert.Resources/Resources.de.resx +++ b/src/LogExpert.Resources/Resources.de.resx @@ -639,7 +639,7 @@ Eingfügt am {0} - Unzureichende Rechte {0}: {1} + Unzureichende Rechte {0}: {1} Fehler während {0} value {1}, min {2}, max {3}, visible {4}: {5} diff --git a/src/LogExpert.Resources/Resources.resx b/src/LogExpert.Resources/Resources.resx index b7026d5f..762a37d8 100644 --- a/src/LogExpert.Resources/Resources.resx +++ b/src/LogExpert.Resources/Resources.resx @@ -645,7 +645,7 @@ Pasted on {0} - Insufficient rights {0}: {1} + Insufficient rights {0}: {1} Error during {0} value {1}, min {2}, max {3}, visible {4}: {5} diff --git a/src/LogExpert.Tests/ColumnizerJsonConverterTests.cs b/src/LogExpert.Tests/ColumnizerJsonConverterTests.cs index 6b9165c5..4645bb7e 100644 --- a/src/LogExpert.Tests/ColumnizerJsonConverterTests.cs +++ b/src/LogExpert.Tests/ColumnizerJsonConverterTests.cs @@ -29,16 +29,8 @@ public class MockColumnizer : ILogLineMemoryColumnizer [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Unit Test")] public string GetColumnName (int column) => "Col"; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Unit Test")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Unit Test")] - public string GetColumnValue (ILogLine line, int column) => ""; - public bool IsTimeshiftImplemented () => false; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Unit Test")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Unit Test")] - public void PushValue (ILogLine line, int column, string value) { } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Unit Test")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Unit Test")] public void SetColumnNames (string[] names) { } @@ -53,26 +45,15 @@ public void SetConfig (object config) { } public string[] GetColumnNames () => throw new NotImplementedException(); - public IColumnizedLogLineMemory SplitLine (ILogLineColumnizerCallback callback, ILogLine line) => throw new NotImplementedException(); - public void SetTimeOffset (int msecOffset) => throw new NotImplementedException(); public int GetTimeOffset () => throw new NotImplementedException(); - public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine logLine) => throw new NotImplementedException(); - - public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue) => throw new NotImplementedException(); - public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback callback, ILogLineMemory logLine) => throw new NotImplementedException(); public DateTime GetTimestamp (ILogLineMemoryColumnizerCallback callback, ILogLineMemory logLine) => throw new NotImplementedException(); public void PushValue (ILogLineMemoryColumnizerCallback callback, int column, string value, string oldValue) => throw new NotImplementedException(); - - IColumnizedLogLine ILogLineColumnizer.SplitLine (ILogLineColumnizerCallback callback, ILogLine logLine) - { - return SplitLine(callback, logLine); - } } public class MockColumnizerWithCustomName : ILogLineMemoryColumnizer @@ -94,18 +75,12 @@ public class MockColumnizerWithCustomName : ILogLineMemoryColumnizer public string[] GetColumnNames () => ["Column1"]; - public IColumnizedLogLineMemory SplitLine (ILogLineColumnizerCallback callback, ILogLine line) => throw new NotImplementedException(); - public bool IsTimeshiftImplemented () => false; public void SetTimeOffset (int msecOffset) => throw new NotImplementedException(); public int GetTimeOffset () => throw new NotImplementedException(); - public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine logLine) => throw new NotImplementedException(); - - public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue) => throw new NotImplementedException(); - public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback callback, ILogLineMemory logLine) { throw new NotImplementedException(); @@ -120,11 +95,6 @@ public void PushValue (ILogLineMemoryColumnizerCallback callback, int column, st { throw new NotImplementedException(); } - - IColumnizedLogLine ILogLineColumnizer.SplitLine (ILogLineColumnizerCallback callback, ILogLine logLine) - { - return SplitLine(callback, logLine); - } } [TestFixture] diff --git a/src/LogExpert.Tests/ColumnizerPickerTest.cs b/src/LogExpert.Tests/ColumnizerPickerTest.cs index 2f0e171a..e6ff80c3 100644 --- a/src/LogExpert.Tests/ColumnizerPickerTest.cs +++ b/src/LogExpert.Tests/ColumnizerPickerTest.cs @@ -156,12 +156,6 @@ private class TestLogLineMemory : ILogLineMemory public int LineNumber { get; set; } - // Explicit implementation for ILogLine.FullLine (string version) - string ILogLine.FullLine => FullLine.ToString(); - - // Explicit implementation for ITextValue.Text - string ITextValue.Text => FullLine.ToString(); - // Explicit implementation for ITextValueMemory.Text (ReadOnlyMemory version) ReadOnlyMemory ITextValueMemory.Text => FullLine; } diff --git a/src/LogExpert.Tests/ConfigManagerPortableModeTests.cs b/src/LogExpert.Tests/ConfigManagerPortableModeTests.cs index c3efadc3..4f7a3206 100644 --- a/src/LogExpert.Tests/ConfigManagerPortableModeTests.cs +++ b/src/LogExpert.Tests/ConfigManagerPortableModeTests.cs @@ -1,7 +1,6 @@ using System.Reflection; using LogExpert.Configuration; -using LogExpert.Core.Config; using NUnit.Framework; @@ -19,7 +18,6 @@ public class ConfigManagerPortableModeTests private ConfigManager _configManager; [SetUp] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void SetUp () { // Create isolated test directory for each test @@ -71,7 +69,6 @@ public void TearDown () /// /// Resets ConfigManager singleton initialization state via reflection. /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] private void ResetConfigManagerInitialization () { var isInitializedField = typeof(ConfigManager).GetField("_isInitialized", BindingFlags.NonPublic | BindingFlags.Instance); @@ -121,7 +118,6 @@ private static void CreateSettingsFile (string directory, string content = """{ [Test] [Category("PortableMode")] [Description("PortableConfigDir should return {AppDir}/configuration/")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void PortableConfigDir_ReturnsConfigurationSubdirectory () { // Act @@ -139,7 +135,6 @@ public void PortableConfigDir_ReturnsConfigurationSubdirectory () [Test] [Category("PortableMode")] [Description("PortableSessionDir should return {AppDir}/configuration/sessions/")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void PortableSessionDir_ReturnsSessionsSubdirectory () { // Act @@ -157,7 +152,6 @@ public void PortableSessionDir_ReturnsSessionsSubdirectory () [Test] [Category("PortableMode")] [Description("ActiveConfigDir should return ConfigDir when portable mode is off")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void ActiveConfigDir_NormalMode_ReturnsConfigDir () { // Arrange @@ -173,7 +167,6 @@ public void ActiveConfigDir_NormalMode_ReturnsConfigDir () [Test] [Category("PortableMode")] [Description("ActiveConfigDir should return PortableConfigDir when portable mode is on")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void ActiveConfigDir_PortableMode_ReturnsPortableConfigDir () { // Arrange @@ -189,7 +182,6 @@ public void ActiveConfigDir_PortableMode_ReturnsPortableConfigDir () [Test] [Category("PortableMode")] [Description("ActiveConfigDir should toggle when PortableMode changes")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void ActiveConfigDir_TogglesWithPortableMode () { // Arrange & Act - Start in normal mode @@ -218,7 +210,6 @@ public void ActiveConfigDir_TogglesWithPortableMode () [Test] [Category("PortableMode")] [Description("ActiveSessionDir should return {AppDir}/sessionFiles when portable mode is off")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void ActiveSessionDir_NormalMode_ReturnsSessionFilesSubdirectory () { // Arrange @@ -235,7 +226,6 @@ public void ActiveSessionDir_NormalMode_ReturnsSessionFilesSubdirectory () [Test] [Category("PortableMode")] [Description("ActiveSessionDir should return PortableSessionDir when portable mode is on")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void ActiveSessionDir_PortableMode_ReturnsPortableSessionDir () { // Arrange @@ -251,7 +241,6 @@ public void ActiveSessionDir_PortableMode_ReturnsPortableSessionDir () [Test] [Category("PortableMode")] [Description("ActiveSessionDir should toggle when PortableMode changes")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void ActiveSessionDir_TogglesWithPortableMode () { // Arrange & Act - Start in normal mode @@ -281,7 +270,6 @@ public void ActiveSessionDir_TogglesWithPortableMode () [Test] [Category("PortableMode")] [Description("MigrateOldPortableLayout should move settings.json from app root to configuration/")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MigrateOldPortableLayout_MovesSettingsFromAppRoot () { // Arrange - Create settings.json in app root (old location) @@ -300,7 +288,6 @@ public void MigrateOldPortableLayout_MovesSettingsFromAppRoot () [Test] [Category("PortableMode")] [Description("MigrateOldPortableLayout should move files from old portable/ directory")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MigrateOldPortableLayout_MovesFilesFromOldPortableDir () { // Arrange - Create old portable directory with marker and config file @@ -324,7 +311,6 @@ public void MigrateOldPortableLayout_MovesFilesFromOldPortableDir () [Test] [Category("PortableMode")] [Description("MigrateOldPortableLayout should move sessionFiles to configuration/sessions/")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MigrateOldPortableLayout_MovesSessionFiles () { // Arrange - Create old sessionFiles directory @@ -346,7 +332,6 @@ public void MigrateOldPortableLayout_MovesSessionFiles () [Test] [Category("PortableMode")] [Description("MigrateOldPortableLayout should delete empty old portable directory")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MigrateOldPortableLayout_DeletesEmptyOldDir () { // Arrange @@ -367,7 +352,6 @@ public void MigrateOldPortableLayout_DeletesEmptyOldDir () [Test] [Category("PortableMode")] [Description("MigrateOldPortableLayout should move subdirectories from old portable/")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MigrateOldPortableLayout_MovesSubdirectories () { // Arrange - Create old portable/Plugins/ directory @@ -392,7 +376,6 @@ public void MigrateOldPortableLayout_MovesSubdirectories () [Test] [Category("PortableMode")] [Description("MigrateOldPortableLayout should move settings.json backup (.bak)")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MigrateOldPortableLayout_MovesSettingsBackup () { // Arrange @@ -413,7 +396,6 @@ public void MigrateOldPortableLayout_MovesSettingsBackup () [Test] [Category("PortableMode")] [Description("CopyConfigToPortable should create the portable configuration directory")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void CopyConfigToPortable_CreatesPortableConfigDir () { // Arrange - Ensure settings.json exists in normal location @@ -431,7 +413,6 @@ public void CopyConfigToPortable_CreatesPortableConfigDir () [Test] [Category("PortableMode")] [Description("CopyConfigToPortable should copy settings.json")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void CopyConfigToPortable_CopiesSettingsFile () { // Arrange @@ -451,7 +432,6 @@ public void CopyConfigToPortable_CopiesSettingsFile () [Test] [Category("PortableMode")] [Description("CopyConfigToPortable should copy trusted-plugins.json")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void CopyConfigToPortable_CopiesTrustedPluginsFile () { // Arrange @@ -471,7 +451,6 @@ public void CopyConfigToPortable_CopiesTrustedPluginsFile () [Test] [Category("PortableMode")] [Description("CopyConfigToPortable should copy Plugins subdirectory recursively")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void CopyConfigToPortable_CopiesPluginsDirectory () { // Arrange @@ -497,7 +476,6 @@ public void CopyConfigToPortable_CopiesPluginsDirectory () [Test] [Category("PortableMode")] [Description("CopyConfigToPortable should copy .dat/.cfg config files")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void CopyConfigToPortable_CopiesColumnizerConfigFiles () { // Arrange @@ -518,15 +496,14 @@ public void CopyConfigToPortable_CopiesColumnizerConfigFiles () [Test] [Category("PortableMode")] [Description("CopyConfigToPortable with no source files should not throw")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Test")] public void CopyConfigToPortable_NoSourceFiles_DoesNotThrow () { // Arrange - ConfigDir might not exist or be empty // (don't create any files) // Act & Assert - Assert.DoesNotThrow(() => _configManager.CopyConfigToPortable(), - "Should not throw when no source files exist"); + Assert.DoesNotThrow(_configManager.CopyConfigToPortable, "Should not throw when no source files exist"); } #endregion @@ -536,7 +513,6 @@ public void CopyConfigToPortable_NoSourceFiles_DoesNotThrow () [Test] [Category("PortableMode")] [Description("MoveConfigFromPortable should move config files back to ConfigDir")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MoveConfigFromPortable_MovesConfigFilesToNormalLocation () { // Arrange - Create files in portable config dir @@ -560,7 +536,6 @@ public void MoveConfigFromPortable_MovesConfigFilesToNormalLocation () [Test] [Category("PortableMode")] [Description("MoveConfigFromPortable should skip the portableMode.json marker file")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MoveConfigFromPortable_SkipsMarkerFile () { // Arrange @@ -581,7 +556,6 @@ public void MoveConfigFromPortable_SkipsMarkerFile () [Test] [Category("PortableMode")] [Description("MoveConfigFromPortable should move Plugins directory")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MoveConfigFromPortable_MovesPluginsDirectory () { // Arrange @@ -601,7 +575,7 @@ public void MoveConfigFromPortable_MovesPluginsDirectory () [Test] [Category("PortableMode")] [Description("MoveConfigFromPortable should move session files to Documents/LogExpert")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Unit Tests")] public void MoveConfigFromPortable_MovesSessionFiles () { // Arrange @@ -631,7 +605,6 @@ public void MoveConfigFromPortable_MovesSessionFiles () [Test] [Category("PortableMode")] [Description("MoveConfigFromPortable should overwrite existing files in ConfigDir")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MoveConfigFromPortable_OverwritesExistingFiles () { // Arrange @@ -652,7 +625,6 @@ public void MoveConfigFromPortable_OverwritesExistingFiles () [Test] [Category("PortableMode")] [Description("MoveConfigFromPortable should clean up empty portable config directory")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MoveConfigFromPortable_CleansUpEmptyPortableDir () { // Arrange - Create portable dir with only one file to move @@ -674,7 +646,6 @@ public void MoveConfigFromPortable_CleansUpEmptyPortableDir () [Test] [Category("PortableMode")] [Description("MoveFileIfExists should move a file and delete source")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MoveFileIfExists_MovesFile () { // Arrange @@ -684,7 +655,7 @@ public void MoveFileIfExists_MovesFile () // Act var method = typeof(ConfigManager).GetMethod("MoveFileIfExists", BindingFlags.NonPublic | BindingFlags.Static); - method?.Invoke(null, [source, target]); + _ = (method?.Invoke(null, [source, target])); // Assert Assert.That(File.Exists(target), Is.True, "Target file should exist"); @@ -695,7 +666,6 @@ public void MoveFileIfExists_MovesFile () [Test] [Category("PortableMode")] [Description("MoveFileIfExists with non-existent source should do nothing")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void MoveFileIfExists_NonExistentSource_DoesNothing () { // Arrange @@ -704,7 +674,7 @@ public void MoveFileIfExists_NonExistentSource_DoesNothing () // Act var method = typeof(ConfigManager).GetMethod("MoveFileIfExists", BindingFlags.NonPublic | BindingFlags.Static); - method?.Invoke(null, [source, target]); + _ = (method?.Invoke(null, [source, target])); // Assert Assert.That(File.Exists(target), Is.False, "Target should not be created"); @@ -713,7 +683,6 @@ public void MoveFileIfExists_NonExistentSource_DoesNothing () [Test] [Category("PortableMode")] [Description("CopyFileIfExists should copy file preserving source")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void CopyFileIfExists_CopiesFile () { // Arrange @@ -723,7 +692,7 @@ public void CopyFileIfExists_CopiesFile () // Act var method = typeof(ConfigManager).GetMethod("CopyFileIfExists", BindingFlags.NonPublic | BindingFlags.Static); - method?.Invoke(null, [source, target]); + _ = (method?.Invoke(null, [source, target])); // Assert Assert.That(File.Exists(source), Is.True, "Source should still exist"); @@ -734,7 +703,6 @@ public void CopyFileIfExists_CopiesFile () [Test] [Category("PortableMode")] [Description("CopyFileIfNotExists should not overwrite existing target")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void CopyFileIfNotExists_DoesNotOverwrite () { // Arrange @@ -745,7 +713,7 @@ public void CopyFileIfNotExists_DoesNotOverwrite () // Act var method = typeof(ConfigManager).GetMethod("CopyFileIfNotExists", BindingFlags.NonPublic | BindingFlags.Static); - method?.Invoke(null, [source, target]); + _ = (method?.Invoke(null, [source, target])); //Assert Assert.That(File.ReadAllText(target), Is.EqualTo("existing content"), @@ -755,7 +723,6 @@ public void CopyFileIfNotExists_DoesNotOverwrite () [Test] [Category("PortableMode")] [Description("CopyDirectoryRecursive should copy all files and subdirectories")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void CopyDirectoryRecursive_CopiesEverything () { // Arrange @@ -770,7 +737,7 @@ public void CopyDirectoryRecursive_CopiesEverything () // Act var method = typeof(ConfigManager).GetMethod("CopyDirectoryRecursive", BindingFlags.NonPublic | BindingFlags.Static); - method?.Invoke(null, [sourceDir, targetDir]); + _ = (method?.Invoke(null, [sourceDir, targetDir])); // Assert Assert.That(File.Exists(Path.Join(targetDir, "file1.txt")), Is.True); @@ -786,7 +753,6 @@ public void CopyDirectoryRecursive_CopiesEverything () [Test] [Category("PortableMode")] [Description("Load should detect new portable layout when portableMode.json exists in configuration/")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void Load_NewPortableLayout_DetectedCorrectly () { // Arrange - Create new portable layout @@ -807,7 +773,6 @@ public void Load_NewPortableLayout_DetectedCorrectly () [Test] [Category("PortableMode")] [Description("Load should detect old portable layout and trigger migration")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void Load_OldPortableLayout_TriggersMigration () { // Arrange - Create old portable layout @@ -840,7 +805,6 @@ public void Load_OldPortableLayout_TriggersMigration () [Test] [Category("PortableMode")] [Description("Full cycle: activate portable mode, copy config, verify, deactivate")] - [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "Unit Test")] public void PortableMode_FullToggleCycle_WorksCorrectly () { // Arrange - Create some config in normal location diff --git a/src/LogExpert.Tests/IPC/ActiveWindowTrackingTests.cs b/src/LogExpert.Tests/IPC/ActiveWindowTrackingTests.cs index 8e14b206..e09b13cf 100644 --- a/src/LogExpert.Tests/IPC/ActiveWindowTrackingTests.cs +++ b/src/LogExpert.Tests/IPC/ActiveWindowTrackingTests.cs @@ -1,5 +1,5 @@ using LogExpert.Classes; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using Moq; diff --git a/src/LogExpert.Tests/IPC/LockInstancePriorityTests.cs b/src/LogExpert.Tests/IPC/LockInstancePriorityTests.cs index 79f9a741..deb69adf 100644 --- a/src/LogExpert.Tests/IPC/LockInstancePriorityTests.cs +++ b/src/LogExpert.Tests/IPC/LockInstancePriorityTests.cs @@ -1,5 +1,5 @@ using LogExpert.Classes; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using LogExpert.UI.Extensions.LogWindow; using Moq; diff --git a/src/LogExpert.Tests/JsonCompactColumnizerTest.cs b/src/LogExpert.Tests/JsonCompactColumnizerTest.cs index a1fef6f5..2ac88e03 100644 --- a/src/LogExpert.Tests/JsonCompactColumnizerTest.cs +++ b/src/LogExpert.Tests/JsonCompactColumnizerTest.cs @@ -56,7 +56,7 @@ public void GetPriority_HappyFile_PriorityMatches (string fileName, Priority pri var path = Path.Join(AppDomain.CurrentDomain.BaseDirectory, fileName); LogfileReader logFileReader = new(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions(), readerType, PluginRegistry.PluginRegistry.Instance, 500); logFileReader.ReadFiles(); - List loglines = + List loglines = [ // Sampling a few lines to select the correct columnizer logFileReader.GetLogLineMemory(0), diff --git a/src/LogExpert.Tests/ReaderTest.cs b/src/LogExpert.Tests/ReaderTest.cs index d55b4a03..791555bd 100644 --- a/src/LogExpert.Tests/ReaderTest.cs +++ b/src/LogExpert.Tests/ReaderTest.cs @@ -2,7 +2,7 @@ using LogExpert.Core.Classes.Log; using LogExpert.Core.Entities; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using NUnit.Framework; @@ -21,6 +21,7 @@ public void Boot () { } + //TODO reimplement private void CompareReaderImplementationsInternal (string fileName, Encoding enc, int maxPosition) { var path = Environment.CurrentDirectory + "\\data\\"; diff --git a/src/LogExpert.Tests/RolloverFilenameHandlerNullTests.cs b/src/LogExpert.Tests/RolloverFilenameHandlerNullTests.cs index 30cf3a0c..63f8b57e 100644 --- a/src/LogExpert.Tests/RolloverFilenameHandlerNullTests.cs +++ b/src/LogExpert.Tests/RolloverFilenameHandlerNullTests.cs @@ -2,7 +2,7 @@ using LogExpert.Core.Classes.Log; using LogExpert.Core.Entities; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using Moq; diff --git a/src/LogExpert.Tests/SquareBracketColumnizerTest.cs b/src/LogExpert.Tests/SquareBracketColumnizerTest.cs index 9ad62987..1b6f017f 100644 --- a/src/LogExpert.Tests/SquareBracketColumnizerTest.cs +++ b/src/LogExpert.Tests/SquareBracketColumnizerTest.cs @@ -58,7 +58,7 @@ public void GetPriority_HappyFile_ColumnCountMatches (string fileName, int count LogfileReader logFileReader = new(path, new EncodingOptions(), true, 40, 50, new MultiFileOptions(), readerType, PluginRegistry.PluginRegistry.Instance, 500); logFileReader.ReadFiles(); - List loglines = + List loglines = [ // Sampling a few lines to select the correct columnizer logFileReader.GetLogLineMemory(0), diff --git a/src/LogExpert.Tests/UI/LogTabWindowResourceTests.cs b/src/LogExpert.Tests/UI/LogTabWindowResourceTests.cs index 678a5ed9..f4f4e39f 100644 --- a/src/LogExpert.Tests/UI/LogTabWindowResourceTests.cs +++ b/src/LogExpert.Tests/UI/LogTabWindowResourceTests.cs @@ -1,7 +1,7 @@ using System.Runtime.Versioning; using LogExpert.Core.Config; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using LogExpert.UI.Extensions.LogWindow; using Moq; diff --git a/src/LogExpert.Tests/UI/LogTabWindowThreadingTests.cs b/src/LogExpert.Tests/UI/LogTabWindowThreadingTests.cs index d0e14ca1..f72c59f9 100644 --- a/src/LogExpert.Tests/UI/LogTabWindowThreadingTests.cs +++ b/src/LogExpert.Tests/UI/LogTabWindowThreadingTests.cs @@ -1,7 +1,7 @@ using System.Runtime.Versioning; using LogExpert.Core.Config; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using LogExpert.UI.Extensions.LogWindow; using Moq; diff --git a/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs b/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs index ee38e79d..492e6913 100644 --- a/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs +++ b/src/LogExpert.UI/Controls/LogWindow/LogWindow.cs @@ -18,9 +18,8 @@ using LogExpert.Core.Config; using LogExpert.Core.Entities; using LogExpert.Core.EventArguments; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using LogExpert.Dialogs; -using LogExpert.Entities; using LogExpert.UI.Dialogs; using LogExpert.UI.Entities; using LogExpert.UI.Extensions; @@ -434,11 +433,6 @@ public ILogLineMemory GetLogLineMemoryWithWait (int lineNum) return _logFileReader.GetLogLineMemoryWithWait(lineNum).Result; } - public ILogLine GetLogLineWithWait (int lineNum) - { - return _logFileReader.GetLogLineWithWait(lineNum).Result; - } - public Bookmark GetBookmarkForLine (int lineNum) { return _bookmarkProvider.GetBookmarkForLine(lineNum); @@ -7696,13 +7690,6 @@ public ILogLineMemory GetCurrentLine () : null; } - public ILogLine GetLine (int lineNum) - { - return lineNum < 0 || _logFileReader == null || lineNum >= _logFileReader.LineCount - ? null - : _logFileReader.GetLogLineMemory(lineNum); - } - public ILogLineMemory GetLineMemory (int lineNum) { return lineNum < 0 || _logFileReader == null || lineNum >= _logFileReader.LineCount diff --git a/src/LogExpert.UI/Controls/LogWindow/TimeSpreadCalculator.cs b/src/LogExpert.UI/Controls/LogWindow/TimeSpreadCalculator.cs index 19c1f89d..6af054a5 100644 --- a/src/LogExpert.UI/Controls/LogWindow/TimeSpreadCalculator.cs +++ b/src/LogExpert.UI/Controls/LogWindow/TimeSpreadCalculator.cs @@ -1,6 +1,6 @@ using LogExpert.Core.Callback; using LogExpert.Core.Classes; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.UI.Controls.LogWindow; diff --git a/src/LogExpert.UI/Dialogs/BookmarkWindow.cs b/src/LogExpert.UI/Dialogs/BookmarkWindow.cs index 683206e9..819aaafa 100644 --- a/src/LogExpert.UI/Dialogs/BookmarkWindow.cs +++ b/src/LogExpert.UI/Dialogs/BookmarkWindow.cs @@ -6,7 +6,7 @@ using LogExpert.Core.Config; using LogExpert.Core.Entities; using LogExpert.Core.Enums; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using LogExpert.UI.Entities; using LogExpert.UI.Interface; diff --git a/src/LogExpert.UI/Dialogs/FilterSelectorForm.cs b/src/LogExpert.UI/Dialogs/FilterSelectorForm.cs index c4ae0a5a..e50e8418 100644 --- a/src/LogExpert.UI/Dialogs/FilterSelectorForm.cs +++ b/src/LogExpert.UI/Dialogs/FilterSelectorForm.cs @@ -2,7 +2,7 @@ using ColumnizerLib; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Dialogs; diff --git a/src/LogExpert.UI/Dialogs/HighlightDialog.cs b/src/LogExpert.UI/Dialogs/HighlightDialog.cs index 5de9d11f..bbce0951 100644 --- a/src/LogExpert.UI/Dialogs/HighlightDialog.cs +++ b/src/LogExpert.UI/Dialogs/HighlightDialog.cs @@ -9,7 +9,7 @@ using LogExpert.Core.Classes.Highlight; using LogExpert.Core.Entities; using LogExpert.Core.Helpers; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using LogExpert.UI.Controls; using LogExpert.UI.Dialogs; using LogExpert.UI.Entities; diff --git a/src/LogExpert.UI/Dialogs/LogTabWindow/LogTabWindow.cs b/src/LogExpert.UI/Dialogs/LogTabWindow/LogTabWindow.cs index f35c92d6..19561ccf 100644 --- a/src/LogExpert.UI/Dialogs/LogTabWindow/LogTabWindow.cs +++ b/src/LogExpert.UI/Dialogs/LogTabWindow/LogTabWindow.cs @@ -16,14 +16,12 @@ using LogExpert.Core.Entities; using LogExpert.Core.Enums; using LogExpert.Core.EventArguments; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using LogExpert.Dialogs; -using LogExpert.Entities; using LogExpert.UI.Dialogs; using LogExpert.UI.Entities; using LogExpert.UI.Extensions; using LogExpert.UI.Extensions.LogWindow; -using LogExpert.UI.Interface.Services; using LogExpert.UI.Services.LedService; using LogExpert.UI.Services.MenuToolbarService; using LogExpert.UI.Services.TabControllerService; diff --git a/src/LogExpert.UI/Dialogs/PluginTrustDialog.cs b/src/LogExpert.UI/Dialogs/PluginTrustDialog.cs index bed9a546..80762c76 100644 --- a/src/LogExpert.UI/Dialogs/PluginTrustDialog.cs +++ b/src/LogExpert.UI/Dialogs/PluginTrustDialog.cs @@ -2,7 +2,7 @@ using System.Runtime.Versioning; using System.Security; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using LogExpert.PluginRegistry; using Newtonsoft.Json; diff --git a/src/LogExpert.UI/Dialogs/SearchDialog.cs b/src/LogExpert.UI/Dialogs/SearchDialog.cs index c29ce47f..7da23af6 100644 --- a/src/LogExpert.UI/Dialogs/SearchDialog.cs +++ b/src/LogExpert.UI/Dialogs/SearchDialog.cs @@ -2,8 +2,8 @@ using System.Globalization; using System.Runtime.Versioning; +using LogExpert.Core.Entities; using LogExpert.Core.Helpers; -using LogExpert.Entities; using LogExpert.UI.Dialogs; namespace LogExpert.Dialogs; diff --git a/src/LogExpert.UI/Dialogs/SettingsDialog.cs b/src/LogExpert.UI/Dialogs/SettingsDialog.cs index 6f24cc91..2f22abc5 100644 --- a/src/LogExpert.UI/Dialogs/SettingsDialog.cs +++ b/src/LogExpert.UI/Dialogs/SettingsDialog.cs @@ -9,7 +9,7 @@ using LogExpert.Core.Config; using LogExpert.Core.Entities; using LogExpert.Core.Enums; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using LogExpert.UI.Controls.LogTabWindow; using LogExpert.UI.Dialogs; using LogExpert.UI.Extensions; diff --git a/src/LogExpert.UI/Extensions/LogWindow/AbstractLogTabWindow.cs b/src/LogExpert.UI/Extensions/LogWindow/AbstractLogTabWindow.cs index 664f4279..972f3c0a 100644 --- a/src/LogExpert.UI/Extensions/LogWindow/AbstractLogTabWindow.cs +++ b/src/LogExpert.UI/Extensions/LogWindow/AbstractLogTabWindow.cs @@ -1,6 +1,6 @@ using System.Runtime.Versioning; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using LogExpert.UI.Controls.LogTabWindow; namespace LogExpert.UI.Extensions.LogWindow; diff --git a/src/LogExpert.UI/Extensions/LogWindow/StaticLogTabWindowData.cs b/src/LogExpert.UI/Extensions/LogWindow/StaticLogTabWindowData.cs index cc356eb6..2c13339e 100644 --- a/src/LogExpert.UI/Extensions/LogWindow/StaticLogTabWindowData.cs +++ b/src/LogExpert.UI/Extensions/LogWindow/StaticLogTabWindowData.cs @@ -1,4 +1,4 @@ -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.UI.Extensions.LogWindow; diff --git a/src/LogExpert.UI/Interface/ILogPaintContextUI.cs b/src/LogExpert.UI/Interface/ILogPaintContextUI.cs index 7462ad82..e4edd3c6 100644 --- a/src/LogExpert.UI/Interface/ILogPaintContextUI.cs +++ b/src/LogExpert.UI/Interface/ILogPaintContextUI.cs @@ -2,7 +2,7 @@ using LogExpert.Core.Classes.Highlight; using LogExpert.Core.Entities; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.UI.Interface; diff --git a/src/LogExpert.UI/Interface/ITabController.cs b/src/LogExpert.UI/Interface/ITabController.cs index 3f59ffe1..496b8749 100644 --- a/src/LogExpert.UI/Interface/ITabController.cs +++ b/src/LogExpert.UI/Interface/ITabController.cs @@ -1,5 +1,4 @@ using LogExpert.UI.Controls.LogWindow; -using LogExpert.UI.Interface.Services; using LogExpert.UI.Services.TabControllerService; using WeifenLuo.WinFormsUI.Docking; diff --git a/src/LogExpert.UI/Services/TabControllerService/TabController.cs b/src/LogExpert.UI/Services/TabControllerService/TabController.cs index 1065ca08..8e7c6f15 100644 --- a/src/LogExpert.UI/Services/TabControllerService/TabController.cs +++ b/src/LogExpert.UI/Services/TabControllerService/TabController.cs @@ -3,7 +3,6 @@ using LogExpert.UI.Controls.LogWindow; using LogExpert.UI.Entities; using LogExpert.UI.Interface; -using LogExpert.UI.Interface.Services; using WeifenLuo.WinFormsUI.Docking; diff --git a/src/LogExpert.UI/Services/TabControllerService/WindowClosingEventArgs.cs b/src/LogExpert.UI/Services/TabControllerService/WindowClosingEventArgs.cs index e5707cf0..b3f57545 100644 --- a/src/LogExpert.UI/Services/TabControllerService/WindowClosingEventArgs.cs +++ b/src/LogExpert.UI/Services/TabControllerService/WindowClosingEventArgs.cs @@ -3,7 +3,7 @@ using LogExpert.UI.Controls.LogWindow; -namespace LogExpert.UI.Interface.Services; +namespace LogExpert.UI.Services.TabControllerService; internal class WindowClosingEventArgs (LogWindow window, bool skipConfirmation) : CancelEventArgs { diff --git a/src/LogExpert/Classes/LogExpertApplicationContext.cs b/src/LogExpert/Classes/LogExpertApplicationContext.cs index 8b6d6986..bb2d73f9 100644 --- a/src/LogExpert/Classes/LogExpertApplicationContext.cs +++ b/src/LogExpert/Classes/LogExpertApplicationContext.cs @@ -1,7 +1,7 @@ using System.Runtime.Versioning; using System.Windows.Forms; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; namespace LogExpert.Classes; diff --git a/src/LogExpert/Classes/LogExpertProxy.cs b/src/LogExpert/Classes/LogExpertProxy.cs index 176eaa2f..4f3c4503 100644 --- a/src/LogExpert/Classes/LogExpertProxy.cs +++ b/src/LogExpert/Classes/LogExpertProxy.cs @@ -2,7 +2,7 @@ using System.Windows.Forms; using LogExpert.Configuration; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using LogExpert.UI.Extensions.LogWindow; using NLog; diff --git a/src/PluginHashGenerator.Tool/Program.cs b/src/PluginHashGenerator.Tool/Program.cs index 4794f778..bb6765b9 100644 --- a/src/PluginHashGenerator.Tool/Program.cs +++ b/src/PluginHashGenerator.Tool/Program.cs @@ -3,7 +3,7 @@ using LogExpert.PluginRegistry; -namespace PluginHashGenerator.Tool; +namespace LogExpert; /// /// Console tool to generate plugin hashes and update the GetBuiltInPluginHashes() method. diff --git a/src/PluginRegistry.Tests/ArchitecturalTests.cs b/src/PluginRegistry.Tests/ArchitecturalTests.cs index 4d40f67a..8fdfcd52 100644 --- a/src/PluginRegistry.Tests/ArchitecturalTests.cs +++ b/src/PluginRegistry.Tests/ArchitecturalTests.cs @@ -1,4 +1,3 @@ -using LogExpert.PluginRegistry; using LogExpert.PluginRegistry.Events; using LogExpert.PluginRegistry.Interfaces; @@ -164,6 +163,7 @@ public void PluginContext_InitializesWithCorrectValues () } [Test] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1305:Specify IFormatProvider", Justification = "Unit Tests")] public void PluginLogger_LogsMessages_WithoutException () { // Arrange diff --git a/src/PluginRegistry.Tests/PerformanceTests.cs b/src/PluginRegistry.Tests/PerformanceTests.cs index d949cc45..04981699 100644 --- a/src/PluginRegistry.Tests/PerformanceTests.cs +++ b/src/PluginRegistry.Tests/PerformanceTests.cs @@ -1,7 +1,5 @@ using ColumnizerLib; -using LogExpert.PluginRegistry; - using NUnit.Framework; namespace LogExpert.PluginRegistry.Tests; @@ -19,6 +17,7 @@ public void Setup () } [TearDown] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Unit Tests")] public void Teardown () { if (Directory.Exists(_testPluginDirectory)) @@ -223,7 +222,7 @@ public async Task PluginCache_LoadPluginWithCacheAsync_ReturnsErrorForNonexisten var pluginPath = "nonexistent.dll"; // Act - var result = await cache.LoadPluginWithCacheAsync(pluginPath); + var result = await cache.LoadPluginWithCacheAsync(pluginPath).ConfigureAwait(false); // Assert Assert.That(result.Success, Is.False); diff --git a/src/PluginRegistry.Tests/PluginEventBusTests.cs b/src/PluginRegistry.Tests/PluginEventBusTests.cs index 904224f8..88f210ab 100644 --- a/src/PluginRegistry.Tests/PluginEventBusTests.cs +++ b/src/PluginRegistry.Tests/PluginEventBusTests.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -using LogExpert.PluginRegistry; using LogExpert.PluginRegistry.Interfaces; using NUnit.Framework; @@ -20,7 +14,7 @@ public class PluginEventBusTests private PluginEventBus _eventBus = null!; [SetUp] - public void SetUp() + public void SetUp () { _eventBus = new PluginEventBus(); } @@ -46,80 +40,89 @@ private class AnotherTestEvent : IPluginEvent #region Subscription Tests [Test] - public void Subscribe_WithValidPluginAndHandler_ShouldNotThrow() + public void Subscribe_WithValidPluginAndHandler_ShouldNotThrow () { // Arrange var pluginName = "TestPlugin"; - Action handler = e => { }; + static void handler (TestEvent e) + { } // Act & Assert - Assert.DoesNotThrow(() => _eventBus.Subscribe(pluginName, handler)); + Assert.DoesNotThrow(() => _eventBus.Subscribe(pluginName, (Action)handler)); } [Test] - public void Subscribe_WithNullPluginName_ShouldThrowArgumentNullException() + public void Subscribe_WithNullPluginName_ShouldThrowArgumentNullException () { // Arrange - Action handler = e => { }; + static void handler (TestEvent e) + { } // Act & Assert - Assert.Throws(() => _eventBus.Subscribe(null!, handler)); + _ = Assert.Throws(() => _eventBus.Subscribe(null!, handler)); } [Test] - public void Subscribe_WithNullHandler_ShouldThrowArgumentNullException() + public void Subscribe_WithNullHandler_ShouldThrowArgumentNullException () { // Arrange var pluginName = "TestPlugin"; // Act & Assert - Assert.Throws(() => _eventBus.Subscribe(pluginName, null!)); + _ = Assert.Throws(() => _eventBus.Subscribe(pluginName, null!)); } [Test] - public void Subscribe_MultiplePluginsToSameEvent_ShouldAllowBoth() + public void Subscribe_MultiplePluginsToSameEvent_ShouldAllowBoth () { // Arrange var plugin1 = "Plugin1"; var plugin2 = "Plugin2"; - Action handler1 = e => { }; - Action handler2 = e => { }; + static void handler1 (TestEvent e) + { } + + static void handler2 (TestEvent e) + { } // Act & Assert Assert.DoesNotThrow(() => { - _eventBus.Subscribe(plugin1, handler1); - _eventBus.Subscribe(plugin2, handler2); + _eventBus.Subscribe(plugin1, (Action)handler1); + _eventBus.Subscribe(plugin2, (Action)handler2); }); } [Test] - public void Subscribe_SamePluginToDifferentEvents_ShouldAllowBoth() + public void Subscribe_SamePluginToDifferentEvents_ShouldAllowBoth () { // Arrange var pluginName = "TestPlugin"; - Action handler1 = e => { }; - Action handler2 = e => { }; + static void handler1 (TestEvent e) + { } + + static void handler2 (AnotherTestEvent e) + { } // Act & Assert Assert.DoesNotThrow(() => { - _eventBus.Subscribe(pluginName, handler1); - _eventBus.Subscribe(pluginName, handler2); + _eventBus.Subscribe(pluginName, (Action)handler1); + _eventBus.Subscribe(pluginName, (Action)handler2); }); } [Test] - public void Subscribe_SamePluginAndEventMultipleTimes_ShouldAllowMultipleSubscriptions() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void Subscribe_SamePluginAndEventMultipleTimes_ShouldAllowMultipleSubscriptions () { // Arrange var pluginName = "TestPlugin"; var callCount = 0; - Action handler = e => callCount++; + void handler (TestEvent e) => callCount++; // Act - _eventBus.Subscribe(pluginName, handler); - _eventBus.Subscribe(pluginName, handler); + _eventBus.Subscribe(pluginName, (Action)handler); + _eventBus.Subscribe(pluginName, (Action)handler); _eventBus.Publish(new TestEvent { Message = "Test" }); // Assert @@ -131,7 +134,8 @@ public void Subscribe_SamePluginAndEventMultipleTimes_ShouldAllowMultipleSubscri #region Publishing Tests [Test] - public void Publish_WithSubscriber_ShouldNotifySubscriber() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void Publish_WithSubscriber_ShouldNotifySubscriber () { // Arrange var pluginName = "TestPlugin"; @@ -150,7 +154,8 @@ public void Publish_WithSubscriber_ShouldNotifySubscriber() } [Test] - public void Publish_WithNoSubscribers_ShouldNotThrow() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void Publish_WithNoSubscribers_ShouldNotThrow () { // Arrange var testEvent = new TestEvent { Message = "Test" }; @@ -160,14 +165,15 @@ public void Publish_WithNoSubscribers_ShouldNotThrow() } [Test] - public void Publish_WithNullEvent_ShouldThrowArgumentNullException() + public void Publish_WithNullEvent_ShouldThrowArgumentNullException () { // Act & Assert - Assert.Throws(() => _eventBus.Publish(null!)); + _ = Assert.Throws(() => _eventBus.Publish(null!)); } [Test] - public void Publish_WithMultipleSubscribers_ShouldNotifyAll() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void Publish_WithMultipleSubscribers_ShouldNotifyAll () { // Arrange var receivedCount = 0; @@ -185,7 +191,8 @@ public void Publish_WithMultipleSubscribers_ShouldNotifyAll() } [Test] - public void Publish_OnlyNotifiesSubscribersOfMatchingEventType() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void Publish_OnlyNotifiesSubscribersOfMatchingEventType () { // Arrange var testEventCount = 0; @@ -203,7 +210,8 @@ public void Publish_OnlyNotifiesSubscribersOfMatchingEventType() } [Test] - public void Publish_WhenHandlerThrows_ShouldNotifyOtherSubscribers() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void Publish_WhenHandlerThrows_ShouldNotifyOtherSubscribers () { // Arrange var callCount = 0; @@ -221,7 +229,8 @@ public void Publish_WhenHandlerThrows_ShouldNotifyOtherSubscribers() } [Test] - public void Publish_PreservesEventData() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void Publish_PreservesEventData () { // Arrange TestEvent? receivedEvent = null; @@ -249,14 +258,15 @@ public void Publish_PreservesEventData() #region Unsubscription Tests [Test] - public void Unsubscribe_WithNullPluginName_ShouldThrowArgumentNullException() + public void Unsubscribe_WithNullPluginName_ShouldThrowArgumentNullException () { // Act & Assert - Assert.Throws(() => _eventBus.Unsubscribe(null!)); + _ = Assert.Throws(() => _eventBus.Unsubscribe(null!)); } [Test] - public void Unsubscribe_AfterSubscribing_ShouldStopReceivingEvents() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void Unsubscribe_AfterSubscribing_ShouldStopReceivingEvents () { // Arrange var pluginName = "TestPlugin"; @@ -273,7 +283,7 @@ public void Unsubscribe_AfterSubscribing_ShouldStopReceivingEvents() } [Test] - public void Unsubscribe_WhenNotSubscribed_ShouldNotThrow() + public void Unsubscribe_WhenNotSubscribed_ShouldNotThrow () { // Arrange var pluginName = "TestPlugin"; @@ -283,7 +293,8 @@ public void Unsubscribe_WhenNotSubscribed_ShouldNotThrow() } [Test] - public void Unsubscribe_OnlyUnsubscribesSpecifiedEventType() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void Unsubscribe_OnlyUnsubscribesSpecifiedEventType () { // Arrange var pluginName = "TestPlugin"; @@ -304,7 +315,8 @@ public void Unsubscribe_OnlyUnsubscribesSpecifiedEventType() } [Test] - public void Unsubscribe_OnlyUnsubscribesSpecifiedPlugin() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void Unsubscribe_OnlyUnsubscribesSpecifiedPlugin () { // Arrange var plugin1Count = 0; @@ -327,14 +339,15 @@ public void Unsubscribe_OnlyUnsubscribesSpecifiedPlugin() #region UnsubscribeAll Tests [Test] - public void UnsubscribeAll_WithNullPluginName_ShouldThrowArgumentNullException() + public void UnsubscribeAll_WithNullPluginName_ShouldThrowArgumentNullException () { // Act & Assert - Assert.Throws(() => _eventBus.UnsubscribeAll(null!)); + _ = Assert.Throws(() => _eventBus.UnsubscribeAll(null!)); } [Test] - public void UnsubscribeAll_ShouldUnsubscribeFromAllEvents() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void UnsubscribeAll_ShouldUnsubscribeFromAllEvents () { // Arrange var pluginName = "TestPlugin"; @@ -355,7 +368,8 @@ public void UnsubscribeAll_ShouldUnsubscribeFromAllEvents() } [Test] - public void UnsubscribeAll_OnlyAffectsSpecifiedPlugin() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void UnsubscribeAll_OnlyAffectsSpecifiedPlugin () { // Arrange var plugin1Count = 0; @@ -374,7 +388,7 @@ public void UnsubscribeAll_OnlyAffectsSpecifiedPlugin() } [Test] - public void UnsubscribeAll_WhenNotSubscribed_ShouldNotThrow() + public void UnsubscribeAll_WhenNotSubscribed_ShouldNotThrow () { // Arrange var pluginName = "TestPlugin"; @@ -384,7 +398,8 @@ public void UnsubscribeAll_WhenNotSubscribed_ShouldNotThrow() } [Test] - public void UnsubscribeAll_WithMultipleSubscriptions_ShouldRemoveAll() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void UnsubscribeAll_WithMultipleSubscriptions_ShouldRemoveAll () { // Arrange var pluginName = "TestPlugin"; @@ -408,7 +423,7 @@ public void UnsubscribeAll_WithMultipleSubscriptions_ShouldRemoveAll() #region Thread Safety Tests [Test] - public void Publish_ConcurrentPublishes_ShouldBeSafe() + public void Publish_ConcurrentPublishes_ShouldBeSafe () { // Arrange var callCount = 0; @@ -428,14 +443,14 @@ public void Publish_ConcurrentPublishes_ShouldBeSafe() tasks.Add(Task.Run(() => _eventBus.Publish(new TestEvent { Message = "Test" }))); } - Task.WaitAll(tasks.ToArray()); + Task.WaitAll([.. tasks]); // Assert Assert.That(callCount, Is.EqualTo(10), "All events should be received"); } [Test] - public void Subscribe_ConcurrentSubscriptions_ShouldBeSafe() + public void Subscribe_ConcurrentSubscriptions_ShouldBeSafe () { // Arrange var tasks = new List(); @@ -448,11 +463,11 @@ public void Subscribe_ConcurrentSubscriptions_ShouldBeSafe() } // Assert - Assert.DoesNotThrow(() => Task.WaitAll(tasks.ToArray())); + Assert.DoesNotThrow(() => Task.WaitAll([.. tasks])); } [Test] - public void SubscribeAndPublish_Concurrent_ShouldBeSafe() + public void SubscribeAndPublish_Concurrent_ShouldBeSafe () { // Arrange var callCount = 0; @@ -460,21 +475,18 @@ public void SubscribeAndPublish_Concurrent_ShouldBeSafe() // Act var tasks = new List(); - + // Subscribe tasks for (var i = 0; i < 5; i++) { var pluginName = $"Plugin{i}"; - tasks.Add(Task.Run(() => - { - _eventBus.Subscribe(pluginName, e => + tasks.Add(Task.Run(() => _eventBus.Subscribe(pluginName, e => { lock (lockObj) { callCount++; } - }); - })); + }))); } // Give subscriptions time to register @@ -486,14 +498,14 @@ public void SubscribeAndPublish_Concurrent_ShouldBeSafe() tasks.Add(Task.Run(() => _eventBus.Publish(new TestEvent { Message = "Test" }))); } - Task.WaitAll(tasks.ToArray()); + Task.WaitAll([.. tasks]); // Assert Assert.That(callCount, Is.GreaterThan(0), "Some events should be received"); } [Test] - public void UnsubscribeDuringPublish_ShouldBeSafe() + public void UnsubscribeDuringPublish_ShouldBeSafe () { // Arrange var publishCount = 0; @@ -512,17 +524,18 @@ public void UnsubscribeDuringPublish_ShouldBeSafe() } // Act - var tasks = new List(); - - // Publish task - tasks.Add(Task.Run(() => + var tasks = new List { - for (var i = 0; i < 100; i++) + // Publish task + Task.Run(() => { - _eventBus.Publish(new TestEvent { Message = "Test" }); - Thread.Sleep(1); - } - })); + for (var i = 0; i < 100; i++) + { + _eventBus.Publish(new TestEvent { Message = "Test" }); + Thread.Sleep(1); + } + }) + }; // Unsubscribe tasks for (var i = 0; i < 10; i++) @@ -536,7 +549,7 @@ public void UnsubscribeDuringPublish_ShouldBeSafe() } // Assert - Assert.DoesNotThrow(() => Task.WaitAll(tasks.ToArray())); + Assert.DoesNotThrow(() => Task.WaitAll([.. tasks])); Assert.That(publishCount, Is.GreaterThan(0), "Some events should be received before unsubscribe"); } @@ -545,21 +558,22 @@ public void UnsubscribeDuringPublish_ShouldBeSafe() #region Edge Case Tests [Test] - public void Subscribe_AfterUnsubscribe_ShouldAllowResubscription() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void Subscribe_AfterUnsubscribe_ShouldAllowResubscription () { // Arrange var pluginName = "TestPlugin"; var callCount = 0; - Action handler = e => callCount++; + void handler (TestEvent e) => callCount++; // Act - _eventBus.Subscribe(pluginName, handler); + _eventBus.Subscribe(pluginName, (Action)handler); _eventBus.Publish(new TestEvent { Message = "Test 1" }); - + _eventBus.Unsubscribe(pluginName); _eventBus.Publish(new TestEvent { Message = "Test 2" }); - - _eventBus.Subscribe(pluginName, handler); + + _eventBus.Subscribe(pluginName, (Action)handler); _eventBus.Publish(new TestEvent { Message = "Test 3" }); // Assert @@ -567,7 +581,7 @@ public void Subscribe_AfterUnsubscribe_ShouldAllowResubscription() } [Test] - public void Publish_WithVeryLongEventData_ShouldWork() + public void Publish_WithVeryLongEventData_ShouldWork () { // Arrange var receivedMessage = ""; @@ -582,7 +596,7 @@ public void Publish_WithVeryLongEventData_ShouldWork() } [Test] - public void Publish_ManyEventsQuickly_ShouldHandleAll() + public void Publish_ManyEventsQuickly_ShouldHandleAll () { // Arrange var callCount = 0; diff --git a/src/PluginRegistry.Tests/PluginLoadProgressTests.cs b/src/PluginRegistry.Tests/PluginLoadProgressTests.cs index ac062a01..e0ad8a5c 100644 --- a/src/PluginRegistry.Tests/PluginLoadProgressTests.cs +++ b/src/PluginRegistry.Tests/PluginLoadProgressTests.cs @@ -1,5 +1,4 @@ using NUnit.Framework; -using LogExpert.PluginRegistry; namespace LogExpert.PluginRegistry.Tests; @@ -7,7 +6,8 @@ namespace LogExpert.PluginRegistry.Tests; public class PluginLoadProgressTests { [Test] - public void PluginLoadProgressEventArgs_Constructor_SetsPropertiesCorrectly() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void PluginLoadProgressEventArgs_Constructor_SetsPropertiesCorrectly () { // Arrange var pluginPath = @"C:\Plugins\TestPlugin.dll"; @@ -37,7 +37,7 @@ public void PluginLoadProgressEventArgs_Constructor_SetsPropertiesCorrectly() } [Test] - public void PluginLoadProgressEventArgs_PercentComplete_CalculatesCorrectly() + public void PluginLoadProgressEventArgs_PercentComplete_CalculatesCorrectly () { // Arrange & Act var args1 = new PluginLoadProgressEventArgs("path", "name", 0, 10, PluginLoadStatus.Started); @@ -51,7 +51,7 @@ public void PluginLoadProgressEventArgs_PercentComplete_CalculatesCorrectly() } [Test] - public void PluginLoadProgressEventArgs_PercentComplete_ZeroTotalReturnsZero() + public void PluginLoadProgressEventArgs_PercentComplete_ZeroTotalReturnsZero () { // Arrange & Act var args = new PluginLoadProgressEventArgs("path", "name", 0, 0, PluginLoadStatus.Started); @@ -61,7 +61,8 @@ public void PluginLoadProgressEventArgs_PercentComplete_ZeroTotalReturnsZero() } [Test] - public void PluginLoadProgressEventArgs_ToString_ReturnsFormattedString() + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] + public void PluginLoadProgressEventArgs_ToString_ReturnsFormattedString () { // Arrange var args = new PluginLoadProgressEventArgs( @@ -83,7 +84,7 @@ public void PluginLoadProgressEventArgs_ToString_ReturnsFormattedString() } [Test] - public void PluginLoadProgressEventArgs_NullMessage_HandledGracefully() + public void PluginLoadProgressEventArgs_NullMessage_HandledGracefully () { // Arrange & Act var args = new PluginLoadProgressEventArgs( @@ -101,21 +102,21 @@ public void PluginLoadProgressEventArgs_NullMessage_HandledGracefully() } [Test] - public void PluginLoadStatus_AllValuesAreDefined() + public void PluginLoadStatus_AllValuesAreDefined () { // Assert - Assert.That(Enum.IsDefined(typeof(PluginLoadStatus), PluginLoadStatus.Started), Is.True); - Assert.That(Enum.IsDefined(typeof(PluginLoadStatus), PluginLoadStatus.Validating), Is.True); - Assert.That(Enum.IsDefined(typeof(PluginLoadStatus), PluginLoadStatus.Validated), Is.True); - Assert.That(Enum.IsDefined(typeof(PluginLoadStatus), PluginLoadStatus.Loading), Is.True); - Assert.That(Enum.IsDefined(typeof(PluginLoadStatus), PluginLoadStatus.Loaded), Is.True); - Assert.That(Enum.IsDefined(typeof(PluginLoadStatus), PluginLoadStatus.Skipped), Is.True); - Assert.That(Enum.IsDefined(typeof(PluginLoadStatus), PluginLoadStatus.Failed), Is.True); - Assert.That(Enum.IsDefined(typeof(PluginLoadStatus), PluginLoadStatus.Completed), Is.True); + Assert.That(Enum.IsDefined(PluginLoadStatus.Started), Is.True); + Assert.That(Enum.IsDefined(PluginLoadStatus.Validating), Is.True); + Assert.That(Enum.IsDefined(PluginLoadStatus.Validated), Is.True); + Assert.That(Enum.IsDefined(PluginLoadStatus.Loading), Is.True); + Assert.That(Enum.IsDefined(PluginLoadStatus.Loaded), Is.True); + Assert.That(Enum.IsDefined(PluginLoadStatus.Skipped), Is.True); + Assert.That(Enum.IsDefined(PluginLoadStatus.Failed), Is.True); + Assert.That(Enum.IsDefined(PluginLoadStatus.Completed), Is.True); } [Test] - public void PluginLoadProgress_MultiplePlugins_CalculatesProgressCorrectly() + public void PluginLoadProgress_MultiplePlugins_CalculatesProgressCorrectly () { // Arrange var totalPlugins = 20; @@ -136,7 +137,7 @@ public void PluginLoadProgress_MultiplePlugins_CalculatesProgressCorrectly() } [Test] - public void PluginLoadProgress_EventArgs_TimestampIsRecent() + public void PluginLoadProgress_EventArgs_TimestampIsRecent () { // Arrange var before = DateTime.UtcNow; @@ -157,7 +158,7 @@ public void PluginLoadProgress_EventArgs_TimestampIsRecent() } [Test] - public void PluginLoadProgress_StatusFlow_IsLogical() + public void PluginLoadProgress_StatusFlow_IsLogical () { // This test documents the expected status flow var expectedFlow = new[] @@ -173,12 +174,12 @@ public void PluginLoadProgress_StatusFlow_IsLogical() // Assert all statuses are in the enum foreach (var status in expectedFlow) { - Assert.That(Enum.IsDefined(typeof(PluginLoadStatus), status), Is.True); + Assert.That(Enum.IsDefined(status), Is.True); } } [Test] - public void PluginLoadProgress_AlternateStatusFlow_SkippedScenario() + public void PluginLoadProgress_AlternateStatusFlow_SkippedScenario () { // Document alternate flow when plugin is skipped var skippedFlow = new[] @@ -190,12 +191,12 @@ public void PluginLoadProgress_AlternateStatusFlow_SkippedScenario() foreach (var status in skippedFlow) { - Assert.That(Enum.IsDefined(typeof(PluginLoadStatus), status), Is.True); + Assert.That(Enum.IsDefined(status), Is.True); } } [Test] - public void PluginLoadProgress_AlternateStatusFlow_FailedScenario() + public void PluginLoadProgress_AlternateStatusFlow_FailedScenario () { // Document alternate flow when plugin fails to load var failedFlow = new[] @@ -209,7 +210,7 @@ public void PluginLoadProgress_AlternateStatusFlow_FailedScenario() foreach (var status in failedFlow) { - Assert.That(Enum.IsDefined(typeof(PluginLoadStatus), status), Is.True); + Assert.That(Enum.IsDefined(status), Is.True); } } } diff --git a/src/PluginRegistry.Tests/PluginManifestTests.cs b/src/PluginRegistry.Tests/PluginManifestTests.cs index 5d19da50..cefc16bb 100644 --- a/src/PluginRegistry.Tests/PluginManifestTests.cs +++ b/src/PluginRegistry.Tests/PluginManifestTests.cs @@ -1,5 +1,3 @@ -using LogExpert.PluginRegistry; - using NUnit.Framework; namespace LogExpert.PluginRegistry.Tests; @@ -17,10 +15,11 @@ public class PluginManifestTests public void SetUp () { _testDataPath = Path.Join(Path.GetTempPath(), "LogExpertManifestTests", Guid.NewGuid().ToString()); - Directory.CreateDirectory(_testDataPath); + _ = Directory.CreateDirectory(_testDataPath); } [TearDown] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Unit Tests")] public void TearDown () { if (Directory.Exists(_testDataPath)) @@ -123,7 +122,7 @@ public void Validate_WithInvalidVersionFormat_ShouldFail () // Assert Assert.That(isValid, Is.False); - Assert.That(errors.Any(e => e.Contains("Invalid version format")), Is.True); + Assert.That(errors.Any(e => e.Contains("Invalid version format", StringComparison.InvariantCultureIgnoreCase)), Is.True); } [Test] @@ -285,7 +284,7 @@ public void Validate_WithInvalidLogExpertVersionRequirement_ShouldFail () // Assert Assert.That(isValid, Is.False); - Assert.That(errors.Any(e => e.Contains("Invalid LogExpert version requirement")), Is.True); + Assert.That(errors.Any(e => e.Contains("Invalid LogExpert version requirement", StringComparison.InvariantCultureIgnoreCase)), Is.True); } [Test] @@ -308,7 +307,7 @@ public void Validate_WithInvalidDotNetVersionRequirement_ShouldFail () // Assert Assert.That(isValid, Is.False); - Assert.That(errors.Any(e => e.Contains("Invalid .NET version requirement")), Is.True); + Assert.That(errors.Any(e => e.Contains("Invalid .NET version requirement", StringComparison.InvariantCultureIgnoreCase)), Is.True); } [Test] @@ -350,7 +349,7 @@ public void Validate_WithValidPermissions_ShouldSucceed () Description = "Test plugin", ApiVersion = "1.0", Main = "TestPlugin.dll", - Permissions = new List { "filesystem:read", "filesystem:write", "network:connect" } + Permissions = ["filesystem:read", "filesystem:write", "network:connect"] }; // Act @@ -373,7 +372,7 @@ public void Validate_WithInvalidPermission_ShouldFail () Description = "Test plugin", ApiVersion = "1.0", Main = "TestPlugin.dll", - Permissions = new List { "invalid:permission" } + Permissions = ["invalid:permission"] }; // Act @@ -381,7 +380,7 @@ public void Validate_WithInvalidPermission_ShouldFail () // Assert Assert.That(isValid, Is.False); - Assert.That(errors.Any(e => e.Contains("Invalid permission")), Is.True); + Assert.That(errors.Any(e => e.Contains("Invalid permission", StringComparison.InvariantCultureIgnoreCase)), Is.True); } [Test] @@ -396,7 +395,7 @@ public void Validate_WithMixedValidAndInvalidPermissions_ShouldFailAndReportInva Description = "Test plugin", ApiVersion = "1.0", Main = "TestPlugin.dll", - Permissions = new List { "filesystem:read", "invalid:permission", "network:connect" } + Permissions = ["filesystem:read", "invalid:permission", "network:connect"] }; // Act @@ -420,15 +419,15 @@ public void Validate_WithAllValidPermissions_ShouldSucceed () Description = "Test plugin", ApiVersion = "1.0", Main = "TestPlugin.dll", - Permissions = new List - { + Permissions = + [ "filesystem:read", "filesystem:write", "network:connect", "config:read", "config:write", "registry:read" - } + ] }; // Act diff --git a/src/PluginRegistry.Tests/PluginPermissionManagerTests.cs b/src/PluginRegistry.Tests/PluginPermissionManagerTests.cs index 0d421c24..96934133 100644 --- a/src/PluginRegistry.Tests/PluginPermissionManagerTests.cs +++ b/src/PluginRegistry.Tests/PluginPermissionManagerTests.cs @@ -1,5 +1,3 @@ -using LogExpert.PluginRegistry; - using NUnit.Framework; namespace LogExpert.PluginRegistry.Tests; @@ -21,6 +19,7 @@ public void SetUp () } [TearDown] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1031:Do not catch general exception types", Justification = "Unit Tests")] public void TearDown () { try @@ -406,7 +405,7 @@ public void SetPermissions_WithValidPluginName_ShouldSetPermissions () public void SetPermissions_WithNullPluginName_ShouldThrowArgumentNullException () { // Act & Assert - Assert.Throws(() => + _ = Assert.Throws(() => PluginPermissionManager.SetPermissions(null!, PluginPermission.FileSystemRead)); } @@ -414,7 +413,7 @@ public void SetPermissions_WithNullPluginName_ShouldThrowArgumentNullException ( public void SetPermissions_WithEmptyPluginName_ShouldThrowArgumentNullException () { // Act & Assert - Assert.Throws(() => + _ = Assert.Throws(() => PluginPermissionManager.SetPermissions("", PluginPermission.FileSystemRead)); } diff --git a/src/PluginRegistry.Tests/PluginValidatorTests.cs b/src/PluginRegistry.Tests/PluginValidatorTests.cs index b19038b0..855e60a8 100644 --- a/src/PluginRegistry.Tests/PluginValidatorTests.cs +++ b/src/PluginRegistry.Tests/PluginValidatorTests.cs @@ -87,7 +87,7 @@ public void ValidatePlugin_WithManifestOut_ShouldPopulateManifest () CreateValidManifest(manifestPath, "TestPlugin"); // Act - var result = PluginValidator.ValidatePlugin(pluginPath, out var manifest); + var result = PluginValidator.ValidatePlugin(pluginPath, out var _); // Assert Assert.That(result, Is.True.Or.False); // Depends on actual validation logic @@ -434,7 +434,7 @@ public void Initialize_WithValidDirectory_UpdatesConfigDirectory () public void Initialize_WithNull_ThrowsArgumentException () { // Act & Assert - Assert.Throws(() => PluginValidator.Initialize(null!)); + _ = Assert.Throws(() => PluginValidator.Initialize(null!)); } [Test] @@ -442,7 +442,7 @@ public void Initialize_WithNull_ThrowsArgumentException () public void Initialize_WithEmptyString_ThrowsArgumentException () { // Act & Assert - Assert.Throws(() => PluginValidator.Initialize(string.Empty)); + _ = Assert.Throws(() => PluginValidator.Initialize(string.Empty)); } [Test] @@ -450,7 +450,7 @@ public void Initialize_WithEmptyString_ThrowsArgumentException () public void Initialize_WithWhitespace_ThrowsArgumentException () { // Act & Assert - Assert.Throws(() => PluginValidator.Initialize(" ")); + _ = Assert.Throws(() => PluginValidator.Initialize(" ")); } [Test] @@ -490,6 +490,7 @@ public void Initialize_WithTrustedPluginsFile_ReloadsConfiguration () [Test] [Description("Initialize should handle directory without trusted-plugins.json gracefully")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "Unit Tests")] public void Initialize_WithoutTrustedPluginsFile_HandlesGracefully () { // Arrange - Directory with no config file diff --git a/src/PluginRegistry/PluginRegistry.cs b/src/PluginRegistry/PluginRegistry.cs index 38be6fae..e79642fa 100644 --- a/src/PluginRegistry/PluginRegistry.cs +++ b/src/PluginRegistry/PluginRegistry.cs @@ -7,7 +7,7 @@ using LogExpert.Core.Classes; using LogExpert.Core.Classes.Columnizer; using LogExpert.Core.Entities; -using LogExpert.Core.Interface; +using LogExpert.Core.Interfaces; using LogExpert.PluginRegistry.Events; using LogExpert.PluginRegistry.FileSystem; using LogExpert.PluginRegistry.Interfaces; diff --git a/src/RegexColumnizer.UnitTests/TestLogLine.cs b/src/RegexColumnizer.UnitTests/TestLogLine.cs index bb9c06fa..5ffa8e8a 100644 --- a/src/RegexColumnizer.UnitTests/TestLogLine.cs +++ b/src/RegexColumnizer.UnitTests/TestLogLine.cs @@ -7,12 +7,8 @@ namespace LogExpert.RegexColumnizer.Tests; internal class TestLogLine (int lineNumber, string fullLine) : ILogLineMemory { - string ILogLine.FullLine { get; } - public int LineNumber { get; set; } = lineNumber; - string ITextValue.Text { get; } - public ReadOnlyMemory FullLine { get; } = fullLine.AsMemory(); public ReadOnlyMemory Text { get; } diff --git a/src/RegexColumnizer/RegexColumnizer.cs b/src/RegexColumnizer/RegexColumnizer.cs index 6d52226f..a1cffc1f 100644 --- a/src/RegexColumnizer/RegexColumnizer.cs +++ b/src/RegexColumnizer/RegexColumnizer.cs @@ -169,17 +169,6 @@ public IColumnizedLogLineMemory SplitLine (ILogLineMemoryColumnizerCallback call return columnizedLogLine; } - /// - /// Splits the specified log line into columns using the provided callback. - /// - /// An object that receives columnization callbacks during the split operation. Cannot be null. - /// The log line to be split into columns. Cannot be null. - /// An object representing the columnized version of the log line. - public IColumnizedLogLineMemory SplitLine (ILogLineColumnizerCallback callback, ILogLine line) - { - return SplitLine(callback as ILogLineMemoryColumnizerCallback, line as ILogLineMemory); - } - /// /// Determines whether timeshift functionality is implemented. /// @@ -208,40 +197,6 @@ public int GetTimeOffset () throw new NotImplementedException(); } - /// - /// Extracts the timestamp from the specified log line using the provided callback. - /// - /// The callback interface used to assist in extracting column data from the log line. Cannot be null. - /// The log line from which to extract the timestamp. Cannot be null. - /// A DateTime value representing the timestamp found in the log line. - /// The method is not implemented. - public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine logLine) - { - throw new NotImplementedException(); - } - - public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue) - { - throw new NotImplementedException(); - } - - /// - /// Configures the columnizer using the specified callback and configuration directory. - /// - /// The callback interface used to interact with the columnizer during configuration. Cannot be null. - /// The path to the directory containing configuration files. Must be a valid directory path. - /// Thrown if configDir is null, empty, or consists only of white-space characters. - public void Configure (ILogLineColumnizerCallback callback, string configDir) - { - // Validate inputs - if (string.IsNullOrWhiteSpace(configDir)) - { - throw new ArgumentException(Resources.RegexColumnizer_Configuration_DirectoryCannotBeNullOrEmpty, nameof(configDir)); - } - - Configure(callback as ILogLineMemoryColumnizerCallback, configDir); - } - /// /// Loads the configuration for the columnizer from the specified directory, using either a JSON or XML /// configuration file if available. @@ -425,17 +380,6 @@ public void PushValue (ILogLineMemoryColumnizerCallback callback, int column, st throw new NotImplementedException(); } - /// - /// Splits the specified log line into columns using the provided callback. - /// - /// An object that provides callback methods for columnization. Cannot be null. - /// The log line to be split into columns. Cannot be null. - /// An object representing the columnized form of the log line. - IColumnizedLogLine ILogLineColumnizer.SplitLine (ILogLineColumnizerCallback callback, ILogLine logLine) - { - return SplitLine(callback, logLine); - } - /// /// Displays a configuration dialog for the columnizer and saves the updated settings to the specified configuration /// directory. diff --git a/src/Solution Items/AssemblyInfo.cs b/src/Solution Items/AssemblyInfo.cs index 8f9e69cf..2bbf4fba 100644 --- a/src/Solution Items/AssemblyInfo.cs +++ b/src/Solution Items/AssemblyInfo.cs @@ -1,5 +1,4 @@ -using System.Reflection; using System.Runtime.InteropServices; [assembly: ComVisible(false)] -//warning CA1824: Mark assemblies with NeutralResourcesLanguageAttribute +[assembly: System.Resources.NeutralResourcesLanguage("en")] \ No newline at end of file From baf9f2e1c1cc0819d961a91146c24047d91e96b3 Mon Sep 17 00:00:00 2001 From: Hirogen Date: Fri, 6 Mar 2026 22:55:39 +0100 Subject: [PATCH 3/6] removed old interface namesapce --- .../Classes/Persister/Persister.cs | 1 - .../IPC/OneInstanceIpcTests.cs | 20 ++++++++----------- .../Services/LedIndicatorServiceTests.cs | 1 - 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/LogExpert.Core/Classes/Persister/Persister.cs b/src/LogExpert.Core/Classes/Persister/Persister.cs index 0bd4e935..da20aac7 100644 --- a/src/LogExpert.Core/Classes/Persister/Persister.cs +++ b/src/LogExpert.Core/Classes/Persister/Persister.cs @@ -2,7 +2,6 @@ using LogExpert.Core.Classes.JsonConverters; using LogExpert.Core.Config; -using LogExpert.Core.Interface; using Newtonsoft.Json; diff --git a/src/LogExpert.Tests/IPC/OneInstanceIpcTests.cs b/src/LogExpert.Tests/IPC/OneInstanceIpcTests.cs index 36dd9c18..dcb7c4cb 100644 --- a/src/LogExpert.Tests/IPC/OneInstanceIpcTests.cs +++ b/src/LogExpert.Tests/IPC/OneInstanceIpcTests.cs @@ -1,8 +1,4 @@ -using LogExpert.Classes; using LogExpert.Core.Classes.IPC; -using LogExpert.Core.Interface; - -using Moq; using Newtonsoft.Json; @@ -31,14 +27,14 @@ public void SerializeCommand_WhenAllowOnlyOneInstance_UsesNewWindowOrLockedWindo // through the public API. This test verifies the expected behavior. // For unit testing, we'd need to make SerializeCommandIntoNonFormattedJSON internal // or use InternalsVisibleTo attribute. - + // For now, we test the IpcMessage structure directly var message = new IpcMessage { Type = allowOnlyOne ? IpcMessageType.NewWindowOrLockedWindow : IpcMessageType.NewWindow, Payload = Newtonsoft.Json.Linq.JObject.FromObject(new LoadPayload { Files = [.. files] }) }; - + var json = JsonConvert.SerializeObject(message, Formatting.None); var deserialized = JsonConvert.DeserializeObject(json); @@ -63,7 +59,7 @@ public void SerializeCommand_WhenMultipleInstancesAllowed_UsesNewWindowType () Type = allowOnlyOne ? IpcMessageType.NewWindowOrLockedWindow : IpcMessageType.NewWindow, Payload = Newtonsoft.Json.Linq.JObject.FromObject(new LoadPayload { Files = [.. files] }) }; - + var json = JsonConvert.SerializeObject(message, Formatting.None); var deserialized = JsonConvert.DeserializeObject(json); @@ -78,9 +74,9 @@ public void IpcMessage_SerializesAndDeserializesCorrectly () var originalMessage = new IpcMessage { Type = IpcMessageType.Load, - Payload = Newtonsoft.Json.Linq.JObject.FromObject(new LoadPayload - { - Files = ["file1.log", "file2.log", "file3.log"] + Payload = Newtonsoft.Json.Linq.JObject.FromObject(new LoadPayload + { + Files = ["file1.log", "file2.log", "file3.log"] }) }; @@ -91,10 +87,10 @@ public void IpcMessage_SerializesAndDeserializesCorrectly () // Assert Assert.That(deserializedMessage, Is.Not.Null); Assert.That(deserializedMessage.Type, Is.EqualTo(originalMessage.Type)); - + var originalPayload = originalMessage.Payload.ToObject(); var deserializedPayload = deserializedMessage.Payload.ToObject(); - + Assert.That(deserializedPayload.Files.Count, Is.EqualTo(originalPayload.Files.Count)); for (int i = 0; i < originalPayload.Files.Count; i++) { diff --git a/src/LogExpert.Tests/Services/LedIndicatorServiceTests.cs b/src/LogExpert.Tests/Services/LedIndicatorServiceTests.cs index c44f3741..d20f5b7d 100644 --- a/src/LogExpert.Tests/Services/LedIndicatorServiceTests.cs +++ b/src/LogExpert.Tests/Services/LedIndicatorServiceTests.cs @@ -1,6 +1,5 @@ using System.Runtime.Versioning; -using LogExpert.UI.Interface.Services; using LogExpert.UI.Services.LedService; using NUnit.Framework; From 88b457be440641a685157df54c19fac51bb921ec Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 6 Mar 2026 21:58:45 +0000 Subject: [PATCH 4/6] chore: update plugin hashes [skip ci] --- .../PluginHashGenerator.Generated.cs | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/PluginRegistry/PluginHashGenerator.Generated.cs b/src/PluginRegistry/PluginHashGenerator.Generated.cs index a7430110..77725cd5 100644 --- a/src/PluginRegistry/PluginHashGenerator.Generated.cs +++ b/src/PluginRegistry/PluginHashGenerator.Generated.cs @@ -10,7 +10,7 @@ public static partial class PluginValidator { /// /// Gets pre-calculated SHA256 hashes for built-in plugins. - /// Generated: 2026-03-06 17:55:27 UTC + /// Generated: 2026-03-06 21:58:44 UTC /// Configuration: Release /// Plugin count: 22 /// @@ -18,28 +18,28 @@ public static Dictionary GetBuiltInPluginHashes() { return new Dictionary(StringComparer.OrdinalIgnoreCase) { - ["AutoColumnizer.dll"] = "9056D83B18F290806F5510679FF7DF7F6E2426FCD41E9A272E551BD9CE254A71", + ["AutoColumnizer.dll"] = "0AACEF6EF2F4C6C6462A4D26EAFDA48E36B442424A2645C1D5BF446FDADBF47C", ["BouncyCastle.Cryptography.dll"] = "E5EEAF6D263C493619982FD3638E6135077311D08C961E1FE128F9107D29EBC6", ["BouncyCastle.Cryptography.dll (x86)"] = "E5EEAF6D263C493619982FD3638E6135077311D08C961E1FE128F9107D29EBC6", - ["CsvColumnizer.dll"] = "5C0930E15B27472ACF3C7D9096CC55C95C94001B1E9367B8D5E3D1D5D44CC60F", - ["CsvColumnizer.dll (x86)"] = "5C0930E15B27472ACF3C7D9096CC55C95C94001B1E9367B8D5E3D1D5D44CC60F", - ["DefaultPlugins.dll"] = "128FB997DD422F5ECB141064E6159CE186D0B93A98677CC8F6A5704804B5262F", - ["FlashIconHighlighter.dll"] = "1149B270FDCAD66E1BEC6806DA9662CA703975397712403DE0CB31AAC048A1C0", - ["GlassfishColumnizer.dll"] = "600E2CED7A8B748204A7F0816289907E0896E1D4CCC5DAC96FDEAAD904BD9224", - ["JsonColumnizer.dll"] = "0B7BD98D696888C7AB06D4165AA9D44468AEA6A4F169453AAF09F550B5F661ED", - ["JsonCompactColumnizer.dll"] = "AEEBCC16171996546924A71EC8C9BBB85E3702AD6338AE5C11D3DECC91CB2A47", - ["Log4jXmlColumnizer.dll"] = "5774021A4EB107E61A124B3BD73E8FE311C5944101BD48D800FA18D92BFE734E", - ["LogExpert.Core.dll"] = "B23C469A4221CDE1DD52B6AE632A9BA0BF0D0BF224E050D715D25FCDE8585340", - ["LogExpert.Resources.dll"] = "510ECEAEB987490CF605095915D71A29E50B0E5DE4826F10E131F0F272669BF9", + ["CsvColumnizer.dll"] = "FD3B14B1995266BDC861B60B73701A17F676CAD05C9A8231CF37661FA7AEDE33", + ["CsvColumnizer.dll (x86)"] = "FD3B14B1995266BDC861B60B73701A17F676CAD05C9A8231CF37661FA7AEDE33", + ["DefaultPlugins.dll"] = "6CD381DC6A87A287F88BA54996963D76C4FB50587179F169F75F483F64506211", + ["FlashIconHighlighter.dll"] = "3125511E388EEB8EA852170950B5A9FC618FF56D641A2B1E6F5685D1A9351F96", + ["GlassfishColumnizer.dll"] = "E1E6C80A0FFB8CE47E163177CF569210E32EE92AE9900F0E639C80E66CE31F29", + ["JsonColumnizer.dll"] = "BE22F8053054F41A5AE5FEE490E982F611A653EF93B58FB6C0B67984363AF693", + ["JsonCompactColumnizer.dll"] = "0DEEF6CE3BC0D219EECB1A7E861E263C0C5C68918C16C7B14B154BC478FAB6EE", + ["Log4jXmlColumnizer.dll"] = "5C7943A4ABB207759418DB3A83F59420CA28EDFBE684FEAE7C2E7F6A34E7F035", + ["LogExpert.Core.dll"] = "402B5B302AB9F673BE6C84260B96466F9C54F802B2DB5FE3A6988AF6B40D7F94", + ["LogExpert.Resources.dll"] = "EC234319D96421E5FCF3E3AE8241C7620EAB1BB34CF7675809F21AD44B28D2CE", ["Microsoft.Extensions.DependencyInjection.Abstractions.dll"] = "67FA4325000DB017DC0C35829B416F024F042D24EFB868BCF17A895EE6500A93", ["Microsoft.Extensions.DependencyInjection.Abstractions.dll (x86)"] = "67FA4325000DB017DC0C35829B416F024F042D24EFB868BCF17A895EE6500A93", ["Microsoft.Extensions.Logging.Abstractions.dll"] = "BB853130F5AFAF335BE7858D661F8212EC653835100F5A4E3AA2C66A4D4F685D", ["Microsoft.Extensions.Logging.Abstractions.dll (x86)"] = "BB853130F5AFAF335BE7858D661F8212EC653835100F5A4E3AA2C66A4D4F685D", - ["RegexColumnizer.dll"] = "B981BA0AF176D7ADF2E72AC57BA7F1A2D340B634AF6D96EBE3BB944CBCB02923", - ["SftpFileSystem.dll"] = "821E9655FE7855376664855177E1F6FB73D856BC9B3C73E261596280A85F53DB", - ["SftpFileSystem.dll (x86)"] = "CDA740FB7098D1CD502BA6A23090431645CCE29084513D560B277F44166C5710", - ["SftpFileSystem.Resources.dll"] = "F1E8B9949092CCD2C0011BF1605EB9AD72C85499D213AB0A44EF064F688549F6", - ["SftpFileSystem.Resources.dll (x86)"] = "F1E8B9949092CCD2C0011BF1605EB9AD72C85499D213AB0A44EF064F688549F6", + ["RegexColumnizer.dll"] = "6A2FB87178CB847BD7F9BC15F99DF5C6F3CCA37DC48F6306EA41C1F719B1FDCD", + ["SftpFileSystem.dll"] = "9041EB19CAFDB134FDA4991F3A2B0D2EACCFE5A8A0F5D8EDB867D7D6D365A9F7", + ["SftpFileSystem.dll (x86)"] = "525AC1C9490F0F7DFD4C758EFF4B033670B99BE1DDD436109CFA2DEE21CBDE7A", + ["SftpFileSystem.Resources.dll"] = "EE2272634FD2B25490172E6733C8A78BBCBF8369F92A792482C404D1A8D59A04", + ["SftpFileSystem.Resources.dll (x86)"] = "EE2272634FD2B25490172E6733C8A78BBCBF8369F92A792482C404D1A8D59A04", }; } From 09fb6f8a7750d3cde78b1e98223215e13c33ddca Mon Sep 17 00:00:00 2001 From: Patrick Bruner Date: Sun, 8 Mar 2026 17:20:23 +0100 Subject: [PATCH 5/6] Potential fix for pull request finding 'Class implements ICloneable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- src/LogExpert.Core/Callback/ColumnizerCallback.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LogExpert.Core/Callback/ColumnizerCallback.cs b/src/LogExpert.Core/Callback/ColumnizerCallback.cs index ae9adc2c..c2e94652 100644 --- a/src/LogExpert.Core/Callback/ColumnizerCallback.cs +++ b/src/LogExpert.Core/Callback/ColumnizerCallback.cs @@ -4,7 +4,7 @@ namespace LogExpert.Core.Callback; -public class ColumnizerCallback (ILogWindow logWindow) : ILogLineMemoryColumnizerCallback, IAutoLogLineMemoryColumnizerCallback, ICloneable +public class ColumnizerCallback (ILogWindow logWindow) : ILogLineMemoryColumnizerCallback, IAutoLogLineMemoryColumnizerCallback { #region Fields private readonly ILogWindow _logWindow = logWindow; @@ -28,7 +28,7 @@ private ColumnizerCallback (ColumnizerCallback original) : this(original._logWin #region Public methods - public object Clone () + public ColumnizerCallback Clone () { return new ColumnizerCallback(this); } From 248c896a0d6d55ee0b73fd545edc6ab5574123f1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 8 Mar 2026 16:23:11 +0000 Subject: [PATCH 6/6] chore: update plugin hashes [skip ci] --- .../PluginHashGenerator.Generated.cs | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/PluginRegistry/PluginHashGenerator.Generated.cs b/src/PluginRegistry/PluginHashGenerator.Generated.cs index 77725cd5..e004689f 100644 --- a/src/PluginRegistry/PluginHashGenerator.Generated.cs +++ b/src/PluginRegistry/PluginHashGenerator.Generated.cs @@ -10,7 +10,7 @@ public static partial class PluginValidator { /// /// Gets pre-calculated SHA256 hashes for built-in plugins. - /// Generated: 2026-03-06 21:58:44 UTC + /// Generated: 2026-03-08 16:23:09 UTC /// Configuration: Release /// Plugin count: 22 /// @@ -18,28 +18,28 @@ public static Dictionary GetBuiltInPluginHashes() { return new Dictionary(StringComparer.OrdinalIgnoreCase) { - ["AutoColumnizer.dll"] = "0AACEF6EF2F4C6C6462A4D26EAFDA48E36B442424A2645C1D5BF446FDADBF47C", + ["AutoColumnizer.dll"] = "7E52C3EF09FBB2BAF60E756374B47BC1454F6AA0682B17A70C77B73FBBE4AFBB", ["BouncyCastle.Cryptography.dll"] = "E5EEAF6D263C493619982FD3638E6135077311D08C961E1FE128F9107D29EBC6", ["BouncyCastle.Cryptography.dll (x86)"] = "E5EEAF6D263C493619982FD3638E6135077311D08C961E1FE128F9107D29EBC6", - ["CsvColumnizer.dll"] = "FD3B14B1995266BDC861B60B73701A17F676CAD05C9A8231CF37661FA7AEDE33", - ["CsvColumnizer.dll (x86)"] = "FD3B14B1995266BDC861B60B73701A17F676CAD05C9A8231CF37661FA7AEDE33", - ["DefaultPlugins.dll"] = "6CD381DC6A87A287F88BA54996963D76C4FB50587179F169F75F483F64506211", - ["FlashIconHighlighter.dll"] = "3125511E388EEB8EA852170950B5A9FC618FF56D641A2B1E6F5685D1A9351F96", - ["GlassfishColumnizer.dll"] = "E1E6C80A0FFB8CE47E163177CF569210E32EE92AE9900F0E639C80E66CE31F29", - ["JsonColumnizer.dll"] = "BE22F8053054F41A5AE5FEE490E982F611A653EF93B58FB6C0B67984363AF693", - ["JsonCompactColumnizer.dll"] = "0DEEF6CE3BC0D219EECB1A7E861E263C0C5C68918C16C7B14B154BC478FAB6EE", - ["Log4jXmlColumnizer.dll"] = "5C7943A4ABB207759418DB3A83F59420CA28EDFBE684FEAE7C2E7F6A34E7F035", - ["LogExpert.Core.dll"] = "402B5B302AB9F673BE6C84260B96466F9C54F802B2DB5FE3A6988AF6B40D7F94", - ["LogExpert.Resources.dll"] = "EC234319D96421E5FCF3E3AE8241C7620EAB1BB34CF7675809F21AD44B28D2CE", + ["CsvColumnizer.dll"] = "E86C364B64ED10619F0248AECC8EDE6A448F3AD983FDD0BBCC700B3D1FFEAEA1", + ["CsvColumnizer.dll (x86)"] = "E86C364B64ED10619F0248AECC8EDE6A448F3AD983FDD0BBCC700B3D1FFEAEA1", + ["DefaultPlugins.dll"] = "245B4948F851C7AFF1C9BE74043EBB05D1E90EA8ECA06570EAB14C8024EDF803", + ["FlashIconHighlighter.dll"] = "28336FFE6C1ED6EEEAE12B12257547197BD135310741C009505006C70397EF8A", + ["GlassfishColumnizer.dll"] = "F5D555078CD5E8B45E532FBE7AAF84C789B950EAFAEE0594F0E954022E05A1C9", + ["JsonColumnizer.dll"] = "2CA4391017ED5A8DB6B4CCECC4ACC97E75CFF34BEEE8785C56867186F431156F", + ["JsonCompactColumnizer.dll"] = "A3F4D8B11C74FE33CFA1D390EF3A7F9253769BB1777C7945FEE663982AB91BD5", + ["Log4jXmlColumnizer.dll"] = "B9AF22F9CAFDE424445B022414ABD12339701337E9E6D2E9B852036A592F8112", + ["LogExpert.Core.dll"] = "8DDD8A0FFE4BF827E50C24C3693C054074BFD8D9994309ED86A7AD80AC385980", + ["LogExpert.Resources.dll"] = "A2587253CF4A9B6DA9559B8A8FE738B59120423836933ADFFF2F2A9A6497A824", ["Microsoft.Extensions.DependencyInjection.Abstractions.dll"] = "67FA4325000DB017DC0C35829B416F024F042D24EFB868BCF17A895EE6500A93", ["Microsoft.Extensions.DependencyInjection.Abstractions.dll (x86)"] = "67FA4325000DB017DC0C35829B416F024F042D24EFB868BCF17A895EE6500A93", ["Microsoft.Extensions.Logging.Abstractions.dll"] = "BB853130F5AFAF335BE7858D661F8212EC653835100F5A4E3AA2C66A4D4F685D", ["Microsoft.Extensions.Logging.Abstractions.dll (x86)"] = "BB853130F5AFAF335BE7858D661F8212EC653835100F5A4E3AA2C66A4D4F685D", - ["RegexColumnizer.dll"] = "6A2FB87178CB847BD7F9BC15F99DF5C6F3CCA37DC48F6306EA41C1F719B1FDCD", - ["SftpFileSystem.dll"] = "9041EB19CAFDB134FDA4991F3A2B0D2EACCFE5A8A0F5D8EDB867D7D6D365A9F7", - ["SftpFileSystem.dll (x86)"] = "525AC1C9490F0F7DFD4C758EFF4B033670B99BE1DDD436109CFA2DEE21CBDE7A", - ["SftpFileSystem.Resources.dll"] = "EE2272634FD2B25490172E6733C8A78BBCBF8369F92A792482C404D1A8D59A04", - ["SftpFileSystem.Resources.dll (x86)"] = "EE2272634FD2B25490172E6733C8A78BBCBF8369F92A792482C404D1A8D59A04", + ["RegexColumnizer.dll"] = "5044E185B46E72F8E13EB32BA3962397461FCAD2152988BBCEFB2FFBCCE9C9F7", + ["SftpFileSystem.dll"] = "BFB9E080FC9619CB3ACD1D9D265C3A1C0A3CC4A8FE35EDAE9D60661C86142E5F", + ["SftpFileSystem.dll (x86)"] = "C73DD9D7B38553DD071220C49E661B8CC4E507271A3F89C75E432E1E58F60498", + ["SftpFileSystem.Resources.dll"] = "1076B7D4AFECC046D6874EEBD2101AE2F554B9CB29AC0FEAAF7DDBC6C1CF1EE7", + ["SftpFileSystem.Resources.dll (x86)"] = "1076B7D4AFECC046D6874EEBD2101AE2F554B9CB29AC0FEAAF7DDBC6C1CF1EE7", }; }