diff --git a/.github/workflows/test_dotnet.yml b/.github/workflows/test_dotnet.yml new file mode 100644 index 00000000..57c53a4e --- /dev/null +++ b/.github/workflows/test_dotnet.yml @@ -0,0 +1,31 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: .NET + +on: + push: + branches: [ "Development" ] + pull_request: + branches: [ "Development" ] + +jobs: + build: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + working-directory: src + - name: Build + run: dotnet build --no-restore + working-directory: src + - name: Test + run: dotnet test --no-build --verbosity normal + working-directory: src diff --git a/src/AutoColumnizer/AutoColumnizer.csproj b/src/AutoColumnizer/AutoColumnizer.csproj index dc8b8316..1bed4e34 100644 --- a/src/AutoColumnizer/AutoColumnizer.csproj +++ b/src/AutoColumnizer/AutoColumnizer.csproj @@ -6,6 +6,7 @@ AutoColumnizer true ..\Solution Items\Key.snk + false false $(SolutionDir)..\bin\$(Configuration)\plugins diff --git a/src/ColumnizerLib/ColumnizerLib.csproj b/src/ColumnizerLib/ColumnizerLib.csproj index bda9d009..e359e5c2 100644 --- a/src/ColumnizerLib/ColumnizerLib.csproj +++ b/src/ColumnizerLib/ColumnizerLib.csproj @@ -7,6 +7,7 @@ false true $(SolutionDir)..\bin\Docs\ColumnizerLib.xml + false false $(SolutionDir)..\bin\$(Configuration) CS1591; diff --git a/src/CsvColumnizer/CsvColumnizer.csproj b/src/CsvColumnizer/CsvColumnizer.csproj index 0b5bf3db..49d00cc8 100644 --- a/src/CsvColumnizer/CsvColumnizer.csproj +++ b/src/CsvColumnizer/CsvColumnizer.csproj @@ -3,6 +3,7 @@ net8.0-windows true Library + false false true true diff --git a/src/DefaultPlugins/DefaultPlugins.csproj b/src/DefaultPlugins/DefaultPlugins.csproj index 72705236..341029e4 100644 --- a/src/DefaultPlugins/DefaultPlugins.csproj +++ b/src/DefaultPlugins/DefaultPlugins.csproj @@ -3,6 +3,7 @@ net8.0-windows true Library + false LogExpert false true diff --git a/src/FlashIconHighlighter/FlashIconHighlighter.csproj b/src/FlashIconHighlighter/FlashIconHighlighter.csproj index b5a8f53b..32d5dbc2 100644 --- a/src/FlashIconHighlighter/FlashIconHighlighter.csproj +++ b/src/FlashIconHighlighter/FlashIconHighlighter.csproj @@ -3,6 +3,7 @@ net8.0-windows true Library + false false true true diff --git a/src/GlassfishColumnizer/GlassfishColumnizer.csproj b/src/GlassfishColumnizer/GlassfishColumnizer.csproj index 4e3ef5cb..c9928ba1 100644 --- a/src/GlassfishColumnizer/GlassfishColumnizer.csproj +++ b/src/GlassfishColumnizer/GlassfishColumnizer.csproj @@ -2,6 +2,7 @@ net8.0-windows Library + false false false $(SolutionDir)..\bin\$(Configuration)\plugins diff --git a/src/JsonColumnizer/JsonColumnizer.csproj b/src/JsonColumnizer/JsonColumnizer.csproj index 08ea9fb1..ffcc325e 100644 --- a/src/JsonColumnizer/JsonColumnizer.csproj +++ b/src/JsonColumnizer/JsonColumnizer.csproj @@ -3,6 +3,7 @@ net8.0-windows true Library + false false true true diff --git a/src/JsonCompactColumnizer/JsonCompactColumnizer.csproj b/src/JsonCompactColumnizer/JsonCompactColumnizer.csproj index 86b2eba4..67cae4d8 100644 --- a/src/JsonCompactColumnizer/JsonCompactColumnizer.csproj +++ b/src/JsonCompactColumnizer/JsonCompactColumnizer.csproj @@ -3,6 +3,7 @@ net8.0-windows true Library + false JsonColumnizer false true diff --git a/src/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj b/src/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj index 8b1834e7..c86df2f4 100644 --- a/src/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj +++ b/src/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj @@ -3,6 +3,7 @@ net8.0-windows true Library + false false true true diff --git a/src/LogExpert/Classes/Log/PositionAwareStreamReaderBase.cs b/src/LogExpert/Classes/Log/PositionAwareStreamReaderBase.cs index 94e4a88f..68e46989 100644 --- a/src/LogExpert/Classes/Log/PositionAwareStreamReaderBase.cs +++ b/src/LogExpert/Classes/Log/PositionAwareStreamReaderBase.cs @@ -1,7 +1,9 @@ -using System; +using LogExpert.Config; +using LogExpert.Entities; + +using System; using System.IO; using System.Text; -using LogExpert.Entities; namespace LogExpert.Classes.Log { @@ -35,7 +37,7 @@ protected PositionAwareStreamReaderBase(Stream stream, EncodingOptions encodingO _posIncPrecomputed = GetPosIncPrecomputed(usedEncoding); _reader = new StreamReader(_stream, usedEncoding, true); - + Position = 0; } @@ -54,7 +56,7 @@ public sealed override long Position /* * 1: Sometime commented (+Encoding.GetPreamble().Length) * 2: Date 1.1 3207 - * 3: Error Message from Piet because of Unicode-Bugs. + * 3: Error Message from Piet because of Unicode-Bugs. * No Idea, if this is OK. * 4: 27.07.09: Preamble-Length is now calculated in CT, because Encoding.GetPreamble().Length * always delivers a fixed length (does not mater what kind of data) @@ -128,9 +130,7 @@ protected virtual void ResetReader() protected StreamReader GetStreamReader() { - if (IsDisposed) throw new ObjectDisposedException(ToString()); - - return _reader; + return IsDisposed ? throw new ObjectDisposedException(ToString()) : _reader; } protected void MovePosition(int offset) @@ -149,11 +149,11 @@ protected void MovePosition(int offset) private int DetectPreambleLengthAndEncoding(out Encoding detectedEncoding) { /* - UTF-8: EF BB BF - UTF-16-Big-Endian-Byteorder: FE FF - UTF-16-Little-Endian-Byteorder: FF FE - UTF-32-Big-Endian-Byteorder: 00 00 FE FF - UTF-32-Little-Endian-Byteorder: FF FE 00 00 + UTF-8: EF BB BF + UTF-16-Big-Endian-Byteorder: FE FF + UTF-16-Little-Endian-Byteorder: FF FE + UTF-32-Big-Endian-Byteorder: 00 00 FE FF + UTF-32-Little-Endian-Byteorder: FF FE 00 00 */ byte[] readPreamble = new byte[4]; @@ -205,17 +205,17 @@ private int GetPosIncPrecomputed(Encoding usedEncoding) switch (usedEncoding) { case UTF8Encoding _: - { - return 0; - } + { + return 0; + } case UnicodeEncoding _: - { - return 2; - } + { + return 2; + } default: - { - return 1; - } + { + return 1; + } } } diff --git a/src/LogExpert/Classes/PluginRegistry.cs b/src/LogExpert/Classes/PluginRegistry.cs index 584c14db..31cad60e 100644 --- a/src/LogExpert/Classes/PluginRegistry.cs +++ b/src/LogExpert/Classes/PluginRegistry.cs @@ -140,7 +140,7 @@ private void LoadPluginAssembly(string dllName, string interfaceName) if (instance is IColumnizerConfigurator configurator) { - configurator.LoadConfig(ConfigManager.Settings.preferences.PortableMode ? ConfigManager.PortableModeDir : ConfigManager.ConfigDir); + configurator.LoadConfig(ConfigManager.Settings.Preferences.PortableMode ? ConfigManager.PortableModeDir : ConfigManager.ConfigDir); } if (instance is ILogExpertPlugin plugin) @@ -154,9 +154,20 @@ private void LoadPluginAssembly(string dllName, string interfaceName) } else { - if (TryAsContextMenu(type)) continue; - if (TryAsKeywordAction(type)) continue; - if (TryAsFileSystem(type)) continue; + if (TryAsContextMenu(type)) + { + continue; + } + + if (TryAsKeywordAction(type)) + { + continue; + } + + if (TryAsFileSystem(type)) + { + continue; + } } } } diff --git a/src/LogExpert/Config/Preferences.cs b/src/LogExpert/Config/Preferences.cs index c0dbc83d..f93647da 100644 --- a/src/LogExpert/Config/Preferences.cs +++ b/src/LogExpert/Config/Preferences.cs @@ -103,6 +103,8 @@ public class Preferences public bool ShowErrorMessageAllowOnlyOneInstances { get; set; } + public int MaxLineLength { get; set; } = 20000; + #endregion } } \ No newline at end of file diff --git a/src/LogExpert/Dialogs/SettingsDialog.Designer.cs b/src/LogExpert/Dialogs/SettingsDialog.Designer.cs index b11f0208..3ccc13f5 100644 --- a/src/LogExpert/Dialogs/SettingsDialog.Designer.cs +++ b/src/LogExpert/Dialogs/SettingsDialog.Designer.cs @@ -32,6 +32,9 @@ private void InitializeComponent() System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsDialog)); tabControlSettings = new System.Windows.Forms.TabControl(); tabPageViewSettings = new System.Windows.Forms.TabPage(); + labelWarningMaximumLineLenght = new System.Windows.Forms.Label(); + upDownMaximumLineLength = new System.Windows.Forms.NumericUpDown(); + labelMaximumLineLength = new System.Windows.Forms.Label(); upDownMaximumFilterEntriesDisplayed = new System.Windows.Forms.NumericUpDown(); labelMaximumFilterEntriesDisplayed = new System.Windows.Forms.Label(); upDownMaximumFilterEntries = new System.Windows.Forms.NumericUpDown(); @@ -155,6 +158,7 @@ private void InitializeComponent() dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); tabControlSettings.SuspendLayout(); tabPageViewSettings.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)upDownMaximumLineLength).BeginInit(); ((System.ComponentModel.ISupportInitialize)upDownMaximumFilterEntriesDisplayed).BeginInit(); ((System.ComponentModel.ISupportInitialize)upDownMaximumFilterEntries).BeginInit(); groupBoxMisc.SuspendLayout(); @@ -210,6 +214,9 @@ private void InitializeComponent() // // tabPageViewSettings // + tabPageViewSettings.Controls.Add(labelWarningMaximumLineLenght); + tabPageViewSettings.Controls.Add(upDownMaximumLineLength); + tabPageViewSettings.Controls.Add(labelMaximumLineLength); tabPageViewSettings.Controls.Add(upDownMaximumFilterEntriesDisplayed); tabPageViewSettings.Controls.Add(labelMaximumFilterEntriesDisplayed); tabPageViewSettings.Controls.Add(upDownMaximumFilterEntries); @@ -228,9 +235,39 @@ private void InitializeComponent() tabPageViewSettings.Text = "View settings"; tabPageViewSettings.UseVisualStyleBackColor = true; // + // labelWarningMaximumLineLenght + // + labelWarningMaximumLineLenght.AutoSize = true; + labelWarningMaximumLineLenght.Location = new System.Drawing.Point(446, 118); + labelWarningMaximumLineLenght.Name = "labelWarningMaximumLineLenght"; + labelWarningMaximumLineLenght.Size = new System.Drawing.Size(482, 15); + labelWarningMaximumLineLenght.TabIndex = 16; + labelWarningMaximumLineLenght.Text = "! Changing the Maximum Line Length can impact performance and is not recommended !"; + // + // upDownMaximumLineLength + // + upDownMaximumLineLength.Location = new System.Drawing.Point(762, 138); + upDownMaximumLineLength.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + upDownMaximumLineLength.Maximum = new decimal(new int[] { 1000000, 0, 0, 0 }); + upDownMaximumLineLength.Minimum = new decimal(new int[] { 20000, 0, 0, 0 }); + upDownMaximumLineLength.Name = "upDownMaximumLineLength"; + upDownMaximumLineLength.Size = new System.Drawing.Size(106, 23); + upDownMaximumLineLength.TabIndex = 15; + upDownMaximumLineLength.Value = new decimal(new int[] { 20000, 0, 0, 0 }); + // + // labelMaximumLineLength + // + labelMaximumLineLength.AutoSize = true; + labelMaximumLineLength.Location = new System.Drawing.Point(467, 140); + labelMaximumLineLength.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + labelMaximumLineLength.Name = "labelMaximumLineLength"; + labelMaximumLineLength.Size = new System.Drawing.Size(217, 15); + labelMaximumLineLength.TabIndex = 14; + labelMaximumLineLength.Text = "Maximum Line Length (restart required)"; + // // upDownMaximumFilterEntriesDisplayed // - upDownMaximumFilterEntriesDisplayed.Location = new System.Drawing.Point(762, 114); + upDownMaximumFilterEntriesDisplayed.Location = new System.Drawing.Point(762, 86); upDownMaximumFilterEntriesDisplayed.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); upDownMaximumFilterEntriesDisplayed.Maximum = new decimal(new int[] { 30, 0, 0, 0 }); upDownMaximumFilterEntriesDisplayed.Minimum = new decimal(new int[] { 10, 0, 0, 0 }); @@ -242,7 +279,7 @@ private void InitializeComponent() // labelMaximumFilterEntriesDisplayed // labelMaximumFilterEntriesDisplayed.AutoSize = true; - labelMaximumFilterEntriesDisplayed.Location = new System.Drawing.Point(462, 117); + labelMaximumFilterEntriesDisplayed.Location = new System.Drawing.Point(467, 88); labelMaximumFilterEntriesDisplayed.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); labelMaximumFilterEntriesDisplayed.Name = "labelMaximumFilterEntriesDisplayed"; labelMaximumFilterEntriesDisplayed.Size = new System.Drawing.Size(179, 15); @@ -251,7 +288,7 @@ private void InitializeComponent() // // upDownMaximumFilterEntries // - upDownMaximumFilterEntries.Location = new System.Drawing.Point(762, 71); + upDownMaximumFilterEntries.Location = new System.Drawing.Point(762, 59); upDownMaximumFilterEntries.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); upDownMaximumFilterEntries.Minimum = new decimal(new int[] { 10, 0, 0, 0 }); upDownMaximumFilterEntries.Name = "upDownMaximumFilterEntries"; @@ -262,7 +299,7 @@ private void InitializeComponent() // labelMaximumFilterEntries // labelMaximumFilterEntries.AutoSize = true; - labelMaximumFilterEntries.Location = new System.Drawing.Point(462, 74); + labelMaximumFilterEntries.Location = new System.Drawing.Point(467, 61); labelMaximumFilterEntries.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); labelMaximumFilterEntries.Name = "labelMaximumFilterEntries"; labelMaximumFilterEntries.Size = new System.Drawing.Size(126, 15); @@ -272,7 +309,7 @@ private void InitializeComponent() // labelDefaultEncoding // labelDefaultEncoding.AutoSize = true; - labelDefaultEncoding.Location = new System.Drawing.Point(462, 34); + labelDefaultEncoding.Location = new System.Drawing.Point(467, 34); labelDefaultEncoding.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); labelDefaultEncoding.Name = "labelDefaultEncoding"; labelDefaultEncoding.Size = new System.Drawing.Size(98, 15); @@ -283,7 +320,7 @@ private void InitializeComponent() // comboBoxEncoding.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; comboBoxEncoding.FormattingEnabled = true; - comboBoxEncoding.Location = new System.Drawing.Point(688, 29); + comboBoxEncoding.Location = new System.Drawing.Point(691, 26); comboBoxEncoding.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); comboBoxEncoding.Name = "comboBoxEncoding"; comboBoxEncoding.Size = new System.Drawing.Size(177, 23); @@ -1626,6 +1663,7 @@ private void InitializeComponent() tabControlSettings.ResumeLayout(false); tabPageViewSettings.ResumeLayout(false); tabPageViewSettings.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)upDownMaximumLineLength).EndInit(); ((System.ComponentModel.ISupportInitialize)upDownMaximumFilterEntriesDisplayed).EndInit(); ((System.ComponentModel.ISupportInitialize)upDownMaximumFilterEntries).EndInit(); groupBoxMisc.ResumeLayout(false); @@ -1801,5 +1839,8 @@ private void InitializeComponent() private System.Windows.Forms.RadioButton radioButtonSessionApplicationStartupDir; private System.Windows.Forms.CheckBox checkBoxShowErrorMessageOnlyOneInstance; private System.Windows.Forms.CheckBox checkBoxDarkMode; + private System.Windows.Forms.NumericUpDown upDownMaximumLineLength; + private System.Windows.Forms.Label labelMaximumLineLength; + private System.Windows.Forms.Label labelWarningMaximumLineLenght; } } diff --git a/src/LogExpert/Dialogs/SettingsDialog.cs b/src/LogExpert/Dialogs/SettingsDialog.cs index 8e1ba2b9..e96346e9 100644 --- a/src/LogExpert/Dialogs/SettingsDialog.cs +++ b/src/LogExpert/Dialogs/SettingsDialog.cs @@ -142,6 +142,8 @@ private void FillDialog() radioButtonSessionApplicationStartupDir.Checked = true; } + upDownMaximumLineLength.Value = Preferences.MaxLineLength; + upDownMaximumFilterEntriesDisplayed.Value = Preferences.maximumFilterEntriesDisplayed; upDownMaximumFilterEntries.Value = Preferences.maximumFilterEntries; diff --git a/src/LogExpert/Dialogs/SettingsDialog.resx b/src/LogExpert/Dialogs/SettingsDialog.resx index c246f94f..2c2d8d82 100644 --- a/src/LogExpert/Dialogs/SettingsDialog.resx +++ b/src/LogExpert/Dialogs/SettingsDialog.resx @@ -126,18 +126,6 @@ True - - True - - - True - - - True - - - True - True @@ -150,12 +138,6 @@ Note: You can always load your logfiles as MultiFile automatically if the files names follow the MultiFile naming rule (<filename>, <filename>.1, <filename>.2, ...). Simply choose 'MultiFile' from the File menu after loading the first file. - - 17, 17 - - - 144, 17 - diff --git a/src/LogExpert/LogExpert.csproj b/src/LogExpert/LogExpert.csproj index 51fa80f5..17baac0b 100644 --- a/src/LogExpert/LogExpert.csproj +++ b/src/LogExpert/LogExpert.csproj @@ -8,6 +8,7 @@ true true $(SolutionDir)..\bin\Docs\LogExpert.xml + false true Auto true diff --git a/src/LogexpertgRPCService/LogexpertgRPCService.csproj b/src/LogexpertgRPCService/LogexpertgRPCService.csproj index 80389635..a5d0b2bf 100644 --- a/src/LogexpertgRPCService/LogexpertgRPCService.csproj +++ b/src/LogexpertgRPCService/LogexpertgRPCService.csproj @@ -2,6 +2,7 @@ net8.0 enable + false enable diff --git a/src/RegexColumnizer/RegexColumnizer.csproj b/src/RegexColumnizer/RegexColumnizer.csproj index 318d2269..c8795f55 100644 --- a/src/RegexColumnizer/RegexColumnizer.csproj +++ b/src/RegexColumnizer/RegexColumnizer.csproj @@ -5,6 +5,7 @@ Library false true + false true false $(SolutionDir)..\bin\$(Configuration)\plugins diff --git a/src/SDK/Columnizer/Columnizer/ExampleColumnizer.csproj b/src/SDK/Columnizer/Columnizer/ExampleColumnizer.csproj index e18960f3..6299cee4 100644 --- a/src/SDK/Columnizer/Columnizer/ExampleColumnizer.csproj +++ b/src/SDK/Columnizer/Columnizer/ExampleColumnizer.csproj @@ -10,6 +10,7 @@ Properties ExampleColumnizer ExampleColumnizer + false v2.0 512 diff --git a/src/SDK/ContextMenu/ContextMenu/ContextMenu.csproj b/src/SDK/ContextMenu/ContextMenu/ContextMenu.csproj index 2d3a1b46..a5692fd2 100644 --- a/src/SDK/ContextMenu/ContextMenu/ContextMenu.csproj +++ b/src/SDK/ContextMenu/ContextMenu/ContextMenu.csproj @@ -10,6 +10,7 @@ Properties ContextMenu ContextMenu + false v2.0 512 diff --git a/src/SDK/CsvColumnizer/CsvColumnizer.csproj b/src/SDK/CsvColumnizer/CsvColumnizer.csproj index cc3504cf..5ac52361 100644 --- a/src/SDK/CsvColumnizer/CsvColumnizer.csproj +++ b/src/SDK/CsvColumnizer/CsvColumnizer.csproj @@ -7,6 +7,7 @@ 2.0 {2563526E-4566-40CB-AA27-587B904FD25B} Library + false Properties CsvColumnizer CsvColumnizer diff --git a/src/SDK/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj b/src/SDK/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj index e4138ed2..3707b501 100644 --- a/src/SDK/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj +++ b/src/SDK/Log4jXmlColumnizer/Log4jXmlColumnizer.csproj @@ -7,6 +7,7 @@ 2.0 {C41A517B-7502-4B17-9119-55D5716FAD65} Library + false Properties Log4jXmlColumnizer Log4jXmlColumnizer diff --git a/src/SftpFileSystemx64/SftpFileSystemx64.csproj b/src/SftpFileSystemx64/SftpFileSystemx64.csproj index 3cd2c2f6..52746ad5 100644 --- a/src/SftpFileSystemx64/SftpFileSystemx64.csproj +++ b/src/SftpFileSystemx64/SftpFileSystemx64.csproj @@ -5,6 +5,7 @@ Library SftpFileSystem SftpFileSystem + false false true true diff --git a/src/SftpFileSystemx86/SftpFileSystemx86.csproj b/src/SftpFileSystemx86/SftpFileSystemx86.csproj index f70e3d23..29a83044 100644 --- a/src/SftpFileSystemx86/SftpFileSystemx86.csproj +++ b/src/SftpFileSystemx86/SftpFileSystemx86.csproj @@ -7,6 +7,7 @@ SftpFileSystem false true + false true SftpFileSystemx86 false diff --git a/src/WinFormsUI/WinFormsUI.csproj b/src/WinFormsUI/WinFormsUI.csproj index 7380312e..664ada6d 100644 --- a/src/WinFormsUI/WinFormsUI.csproj +++ b/src/WinFormsUI/WinFormsUI.csproj @@ -9,6 +9,7 @@ ..\Solution Items\Key.snk SAK SAK + false SAK SAK publish\