Skip to content

Commit db8390e

Browse files
committed
Merge branch 'Development' into darkmode
# Conflicts: # src/LogExpert/Program.cs
2 parents 8a3eb29 + 337cac1 commit db8390e

260 files changed

Lines changed: 23296 additions & 4491 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- Serilog.Formatting.Compact format support
1818

1919
### Technology Stack
20-
- **Primary Language**: C# (.NET 8.0-windows target framework)
20+
- **Primary Language**: C# (.NET 10.0-windows target framework)
2121
- **UI Framework**: Windows Forms
2222
- **Build System**: Nuke Build System with MSBuild
2323
- **Target Platform**: Windows (requires Windows-specific dependencies)
@@ -36,12 +36,12 @@
3636
## Build Instructions
3737

3838
### Prerequisites
39-
**CRITICAL**: This project requires Windows development environment and .NET 9.0.301 SDK or compatible.
39+
**CRITICAL**: This project requires Windows development environment and .NET 10.0.100 SDK or compatible.
4040

4141
### Environment Setup
42-
1. **Install .NET SDK**: Project requires .NET 9.0.301 SDK (specified in `global.json`)
43-
2. **Windows Environment**: Build targets `net8.0-windows` and uses Windows Forms
44-
3. **Visual Studio**: Recommended Visual Studio 2017+ or Visual Studio Code with C# extension
42+
1. **Install .NET SDK**: Project requires .NET 10.0.100 SDK (specified in `global.json`)
43+
2. **Windows Environment**: Build targets `net10.0-windows` and uses Windows Forms
44+
3. **Visual Studio**: Recommended Visual Studio 2026+ or Visual Studio Code with C# extension
4545
4. **Optional Dependencies**:
4646
- Chocolatey (for packaging)
4747
- Inno Setup 5 or 6 (for setup creation)
@@ -88,7 +88,7 @@ dotnet test --no-build --verbosity normal
8888
- **Workaround**: Use Windows environment or Windows Subsystem for Linux with proper .NET Windows SDK
8989

9090
2. **.NET Version Mismatch**:
91-
- Project requires .NET 9.0.301 but may encounter .NET 8.0 environments
91+
- Project requires .NET 10.0.100 but may encounter .NET 8.0 environments
9292
- **Workaround**: Nuke build system automatically downloads correct SDK version
9393

9494
3. **Build Timing**:
@@ -176,7 +176,7 @@ LogExpert/
176176
2. **`.github/workflows/test_dotnet.yml`**:
177177
- Runs on push to Development branch
178178
- Executes unit tests
179-
- Uses .NET 9.0.x SDK
179+
- Uses .NET 10.0.x SDK
180180

181181
#### AppVeyor Integration
182182
- **`appveyor.yml`**: Legacy CI configuration
@@ -224,7 +224,7 @@ Key external dependencies (managed via Directory.Packages.props):
224224
#### Adding Dependencies
225225
1. Update `src/Directory.Packages.props` for version management
226226
2. Add `<PackageReference>` in specific project files
227-
3. Ensure compatibility with .NET 8.0 target framework
227+
3. Ensure compatibility with .NET 10.0 target framework
228228

229229
### Build Troubleshooting
230230
- **Missing Windows SDK**: Ensure Windows development environment

.github/workflows/build_dotnet.yml

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,32 @@ on:
1010

1111
env:
1212
Solution: src/LogExpert.sln
13-
Test_Project: src/LogExpert.Tests/LogExpert.Tests.csproj
13+
Test_Project_LogExpert: src/LogExpert.Tests/LogExpert.Tests.csproj
14+
Test_Project_ColumnizerLib: src/ColumnizerLib.UnitTests/ColumnizerLib.UnitTests.csproj
15+
Test_Project_PluginRegistry: src/PluginRegistry.Tests/PluginRegistry.Tests.csproj
16+
Test_Project_RegexColumnizer: src/RegexColumnizer.UnitTests/RegexColumnizer.UnitTests.csproj
1417

1518
jobs:
1619
build:
17-
permissions:
18-
contents: read
19-
20+
permissions:
21+
contents: write # Changed to 'write' for committing
22+
pull-requests: write # Added for PR operations
23+
2024
strategy:
2125
fail-fast: false
2226
matrix:
2327
configuration: [Debug, Release]
24-
28+
2529
runs-on: windows-latest
2630
name: Build Application - ${{ matrix.configuration }}
27-
31+
2832
steps:
2933
- name: Checkout code
3034
uses: actions/checkout@v4
3135
with:
3236
fetch-depth: 0
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
ref: ${{ github.head_ref }} # Checkout the PR branch
3339

3440
- name: Install .NET Core
3541
uses: actions/setup-dotnet@v4
@@ -40,6 +46,24 @@ jobs:
4046
run: |
4147
dotnet build ${{ env.Solution }} --nologo -v quiet -c ${{ matrix.configuration }}
4248
49+
- name: Generate Plugin Hashes
50+
if: matrix.configuration == 'Release'
51+
run: dotnet run --project src/PluginHashGenerator.Tool/PluginHashGenerator.Tool.csproj -- "bin/Release/" "src/PluginRegistry/PluginHashGenerator.Generated.cs" Release
52+
53+
- name: Commit Updated Hashes
54+
if: matrix.configuration == 'Release'
55+
run: |
56+
git config user.name "github-actions[bot]"
57+
git config user.email "github-actions[bot]@users.noreply.github.com"
58+
git add src/PluginRegistry/PluginHashGenerator.Generated.cs
59+
git diff --staged --quiet
60+
if ($LASTEXITCODE -ne 0) {
61+
git commit -m "chore: update plugin hashes [skip ci]"
62+
git push
63+
} else {
64+
Write-Host "No changes to commit"
65+
}
66+
4367
- name: Upload artifact
4468
uses: actions/upload-artifact@v4
4569
with:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a clone from (no longer exists) <https://logexpert.codeplex.com/>
44

55
## Overview
66

7-
LogExpert is a Windows tail program (a GUI replacement for the Unix tail command).
7+
LogExpert is a Windows feature rich tail program (a GUI replacement for the Unix tail command) with support for plugins, highlighting, filtering, bookmarking, columnizing and more.
88

99
Summary of (most) features:
1010

build/_build.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
<ItemGroup>
1313
<PackageReference Include="chocolatey" Version="2.5.1" />
1414
<PackageReference Include="GitVersion.Core" Version="6.5.0" />
15-
<PackageReference Include="Microsoft.Build" Version="17.14.28" />
16-
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.14.28" />
17-
<PackageReference Include="NuGet.CommandLine" Version="6.14.0">
15+
<PackageReference Include="Microsoft.Build" Version="18.0.2" />
16+
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="18.0.2" />
17+
<PackageReference Include="NuGet.CommandLine" Version="7.0.1">
1818
<PrivateAssets>all</PrivateAssets>
1919
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
2020
</PackageReference>
21-
<PackageReference Include="Nuke.Common" Version="9.0.4" />
21+
<PackageReference Include="NuGet.Versioning" Version="7.0.1" />
22+
<PackageReference Include="Nuke.Common" Version="10.0.0" />
2223
<PackageReference Include="Nuke.GitHub" Version="7.0.0" />
2324
<PackageReference Include="NUnit.ConsoleRunner" Version="3.20.2" />
2425
</ItemGroup>

src/AutoColumnizer/AutoColumnizer.cs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using LogExpert;
2-
3-
using System;
1+
using ColumnizerLib;
42

53
namespace AutoColumnizer;
64

@@ -10,53 +8,58 @@ public class AutoColumnizer : ILogLineColumnizer
108

119
public string Text => GetName();
1210

13-
public bool IsTimeshiftImplemented()
11+
public bool IsTimeshiftImplemented ()
1412
{
1513
return true;
1614
}
1715

18-
public string GetName()
16+
public string GetName ()
1917
{
2018
return "Auto Columnizer";
2119
}
2220

23-
public string GetDescription()
21+
public string GetCustomName ()
22+
{
23+
return GetName();
24+
}
25+
26+
public string GetDescription ()
2427
{
2528
return "Automatically find the right columnizer for any file";
2629
}
2730

2831

29-
public int GetColumnCount()
32+
public int GetColumnCount ()
3033
{
3134
throw new NotImplementedException();
3235
}
3336

34-
public string[] GetColumnNames()
37+
public string[] GetColumnNames ()
3538
{
3639
throw new NotImplementedException();
3740
}
3841

39-
public IColumnizedLogLine SplitLine(ILogLineColumnizerCallback callback, ILogLine line)
42+
public IColumnizedLogLine SplitLine (ILogLineColumnizerCallback callback, ILogLine line)
4043
{
4144
throw new NotImplementedException();
4245
}
4346

44-
public void SetTimeOffset(int msecOffset)
47+
public void SetTimeOffset (int msecOffset)
4548
{
4649
throw new NotImplementedException();
4750
}
4851

49-
public int GetTimeOffset()
52+
public int GetTimeOffset ()
5053
{
5154
throw new NotImplementedException();
5255
}
5356

54-
public DateTime GetTimestamp(ILogLineColumnizerCallback callback, ILogLine line)
57+
public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine line)
5558
{
5659
throw new NotImplementedException();
5760
}
5861

59-
public void PushValue(ILogLineColumnizerCallback callback, int column, string value, string oldValue)
62+
public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue)
6063
{
6164
}
6265

src/AutoColumnizer/AutoColumnizer.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@
1010
<ProjectReference Include="..\ColumnizerLib\ColumnizerLib.csproj" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<None Update="AutoColumnizer.manifest.json">
15+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
16+
</None>
17+
</ItemGroup>
18+
1319
</Project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "AutoColumnizer",
3+
"version": "1.0.0",
4+
"author": "LogExpert Team",
5+
"description": "Automatically detects and applies the appropriate columnizer for any log file format",
6+
"apiVersion": "1.0",
7+
"requires": {
8+
"logExpert": ">=1.20.0",
9+
"dotnet": "10.0"
10+
},
11+
"permissions": [
12+
"filesystem:read",
13+
"config:read"
14+
],
15+
"dependencies": {},
16+
"main": "AutoColumnizer.dll",
17+
"url": "https://github.com/LogExperts/LogExpert",
18+
"license": "MIT"
19+
}

src/ColumnizerLib.UnitTests/ColumnTests.cs

Lines changed: 67 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,94 @@
1-
using LogExpert;
1+
using System.Text;
22

3-
using NUnit.Framework;
3+
using ColumnizerLib;
44

5-
using System;
6-
using System.Text;
5+
using NUnit.Framework;
76

8-
namespace ColumnizerLib.UnitTests;
7+
namespace LogExpert.ColumnizerLib.Tests;
98

109
[TestFixture]
1110
public class ColumnTests
1211
{
12+
[SetUp]
13+
public void SetUp ()
14+
{
15+
// Reset to default before each test
16+
Column.SetMaxDisplayLength(20_000);
17+
}
18+
19+
[Test]
20+
public void Column_DisplayMaxLength_DefaultIs20000 ()
21+
{
22+
Assert.That(Column.GetMaxDisplayLength(), Is.EqualTo(20_000));
23+
}
24+
25+
[Test]
26+
public void Column_DisplayMaxLength_CanBeConfigured ()
27+
{
28+
Column.SetMaxDisplayLength(50_000);
29+
Assert.That(Column.GetMaxDisplayLength(), Is.EqualTo(50_000));
30+
31+
// Reset for other tests
32+
Column.SetMaxDisplayLength(20_000);
33+
}
34+
1335
[Test]
14-
public void Column_LineCutOff ()
36+
public void Column_DisplayMaxLength_EnforcesMinimum ()
1537
{
16-
var expectedFullValue = new StringBuilder().Append('6', 4675).Append("1234").ToString();
17-
var expectedDisplayValue = expectedFullValue[..4675] + "..."; // Using substring shorthand
38+
_ = Assert.Throws<ArgumentOutOfRangeException>(() => Column.SetMaxDisplayLength(500));
39+
}
40+
41+
[Test]
42+
public void Column_TruncatesAtConfiguredDisplayLength ()
43+
{
44+
Column.SetMaxDisplayLength(10_000);
45+
46+
// Create a line longer than the display max length
47+
var longValue = new StringBuilder().Append('X', 15_000).ToString();
1848

1949
Column column = new()
2050
{
21-
FullValue = expectedFullValue
51+
FullValue = longValue
2252
};
2353

24-
Assert.That(column.DisplayValue, Is.EqualTo(expectedDisplayValue));
25-
Assert.That(column.FullValue, Is.EqualTo(expectedFullValue));
54+
// FullValue should contain the full line
55+
Assert.That(column.FullValue, Is.EqualTo(longValue));
56+
Assert.That(column.FullValue.Length, Is.EqualTo(15_000));
57+
58+
// DisplayValue should be truncated at 10,000 with "..." appended
59+
Assert.That(column.DisplayValue.Length, Is.EqualTo(10_003)); // 10000 + "..."
60+
Assert.That(column.DisplayValue.EndsWith("...", StringComparison.OrdinalIgnoreCase), Is.True);
61+
Assert.That(column.DisplayValue.StartsWith("XXX", StringComparison.OrdinalIgnoreCase), Is.True);
62+
63+
// Reset for other tests
64+
Column.SetMaxDisplayLength(20_000);
2665
}
2766

2867
[Test]
29-
public void Column_NoLineCutOff ()
68+
public void Column_NoTruncationWhenBelowLimit ()
3069
{
31-
var expected = new StringBuilder().Append('6', 4675).ToString();
70+
Column.SetMaxDisplayLength(20_000);
71+
72+
var normalValue = new StringBuilder().Append('Y', 5_000).ToString();
3273
Column column = new()
3374
{
34-
FullValue = expected
75+
FullValue = normalValue
3576
};
3677

3778
Assert.That(column.DisplayValue, Is.EqualTo(column.FullValue));
79+
Assert.That(column.DisplayValue.Length, Is.EqualTo(5_000));
3880
}
3981

4082
[Test]
41-
public void Column_NullCharReplacement()
83+
public void Column_NullCharReplacement ()
4284
{
43-
Column column = new();
44-
45-
column.FullValue = "asdf\0";
85+
Column column = new()
86+
{
87+
FullValue = "asdf\0"
88+
};
4689

4790
//Switch between the different implementation for the windows versions
48-
//Not that great solution but currently I'm out of ideas, I know that currently
91+
//Not that great solution but currently I'm out of ideas, I know that currently
4992
//only one implementation depending on the windows version is executed
5093
if (Environment.Version >= Version.Parse("6.2"))
5194
{
@@ -60,11 +103,12 @@ public void Column_NullCharReplacement()
60103
}
61104

62105
[Test]
63-
public void Column_TabReplacement()
106+
public void Column_TabReplacement ()
64107
{
65-
Column column = new();
66-
67-
column.FullValue = "asdf\t";
108+
Column column = new()
109+
{
110+
FullValue = "asdf\t"
111+
};
68112

69113
Assert.That(column.DisplayValue, Is.EqualTo("asdf "));
70114
Assert.That(column.FullValue, Is.EqualTo("asdf\t"));

0 commit comments

Comments
 (0)