Skip to content

Commit 73c1ff6

Browse files
authored
Merge pull request #486 from LogExperts/plugin-repository-optimizations
Plugin repository rework and optimizations
2 parents 1eb4b18 + 2ba52b8 commit 73c1ff6

122 files changed

Lines changed: 16851 additions & 2541 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/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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
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.0">
1818
<PrivateAssets>all</PrivateAssets>
1919
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
2020
</PackageReference>
21+
<PackageReference Include="NuGet.Versioning" Version="7.0.0" />
2122
<PackageReference Include="Nuke.Common" Version="9.0.4" />
2223
<PackageReference Include="Nuke.GitHub" Version="7.0.0" />
2324
<PackageReference Include="NUnit.ConsoleRunner" Version="3.20.2" />

src/AutoColumnizer/AutoColumnizer.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using LogExpert;
2-
31
using System;
42

3+
using LogExpert;
4+
55
namespace AutoColumnizer;
66

77
public class AutoColumnizer : ILogLineColumnizer
@@ -10,53 +10,53 @@ public class AutoColumnizer : ILogLineColumnizer
1010

1111
public string Text => GetName();
1212

13-
public bool IsTimeshiftImplemented()
13+
public bool IsTimeshiftImplemented ()
1414
{
1515
return true;
1616
}
1717

18-
public string GetName()
18+
public string GetName ()
1919
{
2020
return "Auto Columnizer";
2121
}
2222

23-
public string GetDescription()
23+
public string GetDescription ()
2424
{
2525
return "Automatically find the right columnizer for any file";
2626
}
2727

2828

29-
public int GetColumnCount()
29+
public int GetColumnCount ()
3030
{
3131
throw new NotImplementedException();
3232
}
3333

34-
public string[] GetColumnNames()
34+
public string[] GetColumnNames ()
3535
{
3636
throw new NotImplementedException();
3737
}
3838

39-
public IColumnizedLogLine SplitLine(ILogLineColumnizerCallback callback, ILogLine line)
39+
public IColumnizedLogLine SplitLine (ILogLineColumnizerCallback callback, ILogLine line)
4040
{
4141
throw new NotImplementedException();
4242
}
4343

44-
public void SetTimeOffset(int msecOffset)
44+
public void SetTimeOffset (int msecOffset)
4545
{
4646
throw new NotImplementedException();
4747
}
4848

49-
public int GetTimeOffset()
49+
public int GetTimeOffset ()
5050
{
5151
throw new NotImplementedException();
5252
}
5353

54-
public DateTime GetTimestamp(ILogLineColumnizerCallback callback, ILogLine line)
54+
public DateTime GetTimestamp (ILogLineColumnizerCallback callback, ILogLine line)
5555
{
5656
throw new NotImplementedException();
5757
}
5858

59-
public void PushValue(ILogLineColumnizerCallback callback, int column, string value, string oldValue)
59+
public void PushValue (ILogLineColumnizerCallback callback, int column, string value, string oldValue)
6060
{
6161
}
6262

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/Column.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using System;
22
using System.Collections.Generic;
33

4-
namespace LogExpert;
4+
using LogExpert;
5+
6+
namespace ColumnizerLib;
57

68
public class Column : IColumn
79
{
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Globalization;
4-
using System.Text;
5-
61
namespace LogExpert;
72

83
/// <summary>
@@ -17,29 +12,35 @@ public interface ILogExpertLogger
1712
/// The logger in LogExpert will automatically add the class and the method name of the caller.
1813
/// </summary>
1914
/// <param name="msg">A message to be logged.</param>
20-
void Info(string msg);
15+
void Info (string msg);
16+
17+
/// <summary>
18+
/// Writes an informational message using the specified format provider.
19+
/// </summary>
20+
/// <param name="formatProvider">An object that supplies culture-specific formatting information for the message. Cannot be null.</param>
21+
/// <param name="msg">The informational message to write. Cannot be null.</param>
2122
void Info (IFormatProvider formatProvider, string msg);
2223

2324
/// <summary>
2425
/// Logs a message on DEBUG level to LogExpert#s log file. The logfile is only active in debug builds.
2526
/// The logger in LogExpert will automatically add the class and the method name of the caller.
2627
/// </summary>
2728
/// <param name="msg">A message to be logged.</param>
28-
void Debug(string msg);
29+
void Debug (string msg);
2930

3031
/// <summary>
3132
/// Logs a message on WARN level to LogExpert#s log file. The logfile is only active in debug builds.
3233
/// The logger in LogExpert will automatically add the class and the method name of the caller.
3334
/// </summary>
3435
/// <param name="msg">A message to be logged.</param>
35-
void LogWarn(string msg);
36+
void LogWarn (string msg);
3637

3738
/// <summary>
3839
/// Logs a message on ERROR level to LogExpert#s log file. The logfile is only active in debug builds.
3940
/// The logger in LogExpert will automatically add the class and the method name of the caller.
4041
/// </summary>
4142
/// <param name="msg">A message to be logged.</param>
42-
void LogError(string msg);
43+
void LogError (string msg);
4344

4445
#endregion
4546
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
namespace LogExpert;
2+
3+
/// <summary>
4+
/// Provides context information to plugins during initialization.
5+
/// </summary>
6+
public interface IPluginContext
7+
{
8+
/// <summary>
9+
/// Logger for the plugin to use for diagnostic output.
10+
/// </summary>
11+
ILogExpertLogger Logger { get; }
12+
13+
/// <summary>
14+
/// Directory where the plugin assembly is located.
15+
/// </summary>
16+
string PluginDirectory { get; }
17+
18+
/// <summary>
19+
/// Version of the host application (LogExpert).
20+
/// </summary>
21+
Version HostVersion { get; }
22+
23+
/// <summary>
24+
/// Directory where the plugin can store configuration files.
25+
/// Typically %APPDATA%\LogExpert\Plugins\{PluginName}\
26+
/// </summary>
27+
string ConfigurationDirectory { get; }
28+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
namespace LogExpert;
2+
3+
/// <summary>
4+
/// Defines lifecycle events for plugins.
5+
/// Plugins can optionally implement this interface to receive lifecycle notifications.
6+
/// </summary>
7+
public interface IPluginLifecycle
8+
{
9+
/// <summary>
10+
/// Called when the plugin is first loaded.
11+
/// Use this to initialize resources, load configuration, etc.
12+
/// </summary>
13+
/// <param name="context">Context providing information about the host environment</param>
14+
void Initialize (IPluginContext context);
15+
16+
/// <summary>
17+
/// Called when the application is shutting down.
18+
/// Use this to cleanup resources, save state, etc.
19+
/// </summary>
20+
void Shutdown ();
21+
22+
/// <summary>
23+
/// Called when the plugin should reload its configuration.
24+
/// Use this to refresh settings without restarting the application.
25+
/// </summary>
26+
void Reload ();
27+
}

0 commit comments

Comments
 (0)