Skip to content

Commit 0cebc5c

Browse files
authored
Merge pull request #538 from LogExperts/Development
Version 1.30.0 To Master
2 parents 3d46e96 + 7f8bec7 commit 0cebc5c

File tree

475 files changed

+62927
-8244
lines changed

Some content is hidden

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

475 files changed

+62927
-8244
lines changed

.devcontainer/devcontainer.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
3+
{
4+
"name": "C# (.NET)",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0",
7+
"features": {
8+
"ghcr.io/devcontainers/features/dotnet:2": {}
9+
},
10+
11+
// Features to add to the dev container. More info: https://containers.dev/features.
12+
// "features": {},
13+
14+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
15+
// "forwardPorts": [5000, 5001],
16+
// "portsAttributes": {
17+
// "5001": {
18+
// "protocol": "https"
19+
// }
20+
// }
21+
22+
// Use 'postCreateCommand' to run commands after the container is created.
23+
// "postCreateCommand": "dotnet restore",
24+
25+
// Configure tool-specific properties.
26+
// Configure tool-specific properties.
27+
"customizations": {
28+
// Configure properties specific to VS Code.
29+
"vscode": {
30+
// Add the IDs of extensions you want installed when the container is created.
31+
"extensions": [
32+
"streetsidesoftware.code-spell-checker",
33+
"github.vscode-github-actions",
34+
"davidanson.vscode-markdownlint",
35+
"mhutchie.git-graph",
36+
"ms-dotnettools.csdevkit"
37+
]
38+
}
39+
}
40+
41+
42+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
43+
// "remoteUser": "root"
44+
}

.github/copilot-instructions.md

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
# GitHub Copilot Instructions for LogExpert
2+
3+
## Repository Overview
4+
5+
**LogExpert** is a Windows-based log file tail and analysis application written in C#. It's a GUI replacement for the Unix tail command, originally from CodePlex, with extensive features for viewing, analyzing, and filtering log files.
6+
7+
### Key Features
8+
- Tail mode for real-time log monitoring
9+
- MDI-Interface with tabs for multiple files
10+
- Search functionality including RegEx support
11+
- Bookmarks and highlighting capabilities
12+
- Flexible filter views with filter-to-tab functionality
13+
- Columnizer plugins for parsing structured logs
14+
- Unicode support and log4j XML file support
15+
- 3rd party plugin architecture
16+
- Automatic columnizer detection (experimental)
17+
- Serilog.Formatting.Compact format support
18+
19+
### Technology Stack
20+
- **Primary Language**: C# (.NET 10.0-windows target framework)
21+
- **UI Framework**: Windows Forms
22+
- **Build System**: Nuke Build System with MSBuild
23+
- **Target Platform**: Windows (requires Windows-specific dependencies)
24+
- **Package Management**: NuGet with central package management
25+
- **Testing**: NUnit framework
26+
- **CI/CD**: GitHub Actions + AppVeyor
27+
28+
## High-Level Repository Information
29+
30+
- **Repository Size**: Medium (~26 source projects)
31+
- **Project Type**: Desktop Application (Windows Forms)
32+
- **Architecture**: Plugin-based architecture with columnizers
33+
- **Main Entry Point**: `src/LogExpert/Program.cs`
34+
- **Main Solution**: `src/LogExpert.sln`
35+
36+
## Build Instructions
37+
38+
### Prerequisites
39+
**CRITICAL**: This project requires Windows development environment and .NET 10.0.100 SDK or compatible.
40+
41+
### Environment Setup
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
45+
4. **Optional Dependencies**:
46+
- Chocolatey (for packaging)
47+
- Inno Setup 5 or 6 (for setup creation)
48+
49+
### Build Commands
50+
51+
#### Using Nuke Build System (Recommended)
52+
```bash
53+
# Windows Command Prompt/PowerShell
54+
./build.ps1
55+
56+
# Cross-platform (Linux/macOS) - Note: Limited functionality
57+
./build.sh
58+
```
59+
60+
#### Common Nuke Build Targets
61+
```bash
62+
# Clean and build
63+
./build.ps1 --target Clean Compile
64+
65+
# Run tests
66+
./build.ps1 --target Test
67+
68+
# Create packages
69+
./build.ps1 --target Pack
70+
71+
# Full release build with setup
72+
./build.ps1 --target Clean Pack CreateSetup --configuration Release
73+
```
74+
75+
#### Direct .NET Commands
76+
```bash
77+
# From src/ directory
78+
dotnet restore
79+
dotnet build --no-restore
80+
dotnet test --no-build --verbosity normal
81+
```
82+
83+
### Known Build Issues and Workarounds
84+
85+
1. **Cross-Platform Limitations**:
86+
- Linux/macOS builds will fail due to missing Windows Desktop SDK components
87+
- Error: "Microsoft.NET.Sdk.WindowsDesktop/targets" not found
88+
- **Workaround**: Use Windows environment or Windows Subsystem for Linux with proper .NET Windows SDK
89+
90+
2. **.NET Version Mismatch**:
91+
- Project requires .NET 10.0.100 but may encounter .NET 8.0 environments
92+
- **Workaround**: Nuke build system automatically downloads correct SDK version
93+
94+
3. **Build Timing**:
95+
- Full build: ~2-5 minutes on modern hardware
96+
- Test execution: ~30 seconds to 2 minutes
97+
- Package creation: Additional 1-3 minutes
98+
99+
### Validation Steps
100+
Always run these validation steps after making changes:
101+
1. `./build.ps1 --target Clean Compile` (ensures clean build)
102+
2. `./build.ps1 --target Test` (runs all unit tests)
103+
3. Review build output in `bin/` directory
104+
4. Check for warnings in build output
105+
106+
## Project Layout and Architecture
107+
108+
### Repository Structure
109+
```
110+
LogExpert/
111+
├── .github/ # GitHub Actions workflows
112+
│ └── workflows/ # build_dotnet.yml, test_dotnet.yml
113+
├── src/ # Main source directory
114+
│ ├── LogExpert.sln # Main solution file
115+
│ ├── LogExpert/ # Main application project
116+
│ ├── LogExpert.Core/ # Core functionality library
117+
│ ├── LogExpert.UI/ # UI components library
118+
│ ├── LogExpert.Resources/ # Resource files
119+
│ ├── ColumnizerLib/ # Plugin interface library
120+
│ ├── Columnizers/ # Built-in columnizer plugins
121+
│ │ ├── CsvColumnizer/
122+
│ │ ├── JsonColumnizer/
123+
│ │ ├── RegexColumnizer/
124+
│ │ └── ... # Other columnizers
125+
│ ├── Tests/ # Test projects
126+
│ │ ├── LogExpert.Tests/
127+
│ │ ├── ColumnizerLib.UnitTests/
128+
│ │ └── RegexColumnizer.UnitTests/
129+
│ └── Solution Items/ # Shared configuration files
130+
├── build/ # Nuke build system
131+
│ ├── Build.cs # Main build script
132+
│ └── _build.csproj # Build project file
133+
├── chocolatey/ # Chocolatey package configuration
134+
├── lib/ # External libraries
135+
├── global.json # .NET SDK version pinning
136+
├── GitVersion.yml # Version configuration
137+
├── Directory.Build.props # MSBuild properties
138+
└── Directory.Packages.props # NuGet package versions
139+
```
140+
141+
### Key Configuration Files
142+
- **`global.json`**: Specifies required .NET SDK version (9.0.301)
143+
- **`src/Directory.Build.props`**: Common MSBuild properties for all projects
144+
- **`src/Directory.Packages.props`**: Centralized NuGet package version management
145+
- **`.editorconfig`**: Code style and formatting rules (comprehensive 4000+ line config)
146+
- **`GitVersion.yml`**: Semantic versioning configuration
147+
- **`appveyor.yml`**: AppVeyor CI configuration
148+
149+
### Architectural Components
150+
151+
#### Main Application (`src/LogExpert/`)
152+
- **`Program.cs`**: Application entry point with IPC for single-instance mode
153+
- **Target Framework**: `net8.0-windows`
154+
- **Dependencies**: LogExpert.UI, LogExpert.Core, ColumnizerLib, PluginRegistry
155+
156+
#### Core Libraries
157+
- **`LogExpert.Core`**: Core business logic and interfaces
158+
- **`LogExpert.UI`**: Windows Forms UI components
159+
- **`LogExpert.Resources`**: Localization and resource files
160+
- **`ColumnizerLib`**: Plugin interface definitions
161+
162+
#### Plugin System
163+
- **Columnizers**: Parse log lines into columns (CSV, JSON, RegEx, etc.)
164+
- **File System Plugins**: Support for different file sources (local, SFTP)
165+
- **Plugin Discovery**: Automatic plugin loading from application directory
166+
167+
### CI/CD Pipeline
168+
169+
#### GitHub Actions
170+
1. **`.github/workflows/build_dotnet.yml`**:
171+
- Triggers on PR to Development branch
172+
- Builds Debug and Release configurations
173+
- Uploads build artifacts
174+
- Uses windows-latest runner
175+
176+
2. **`.github/workflows/test_dotnet.yml`**:
177+
- Runs on push to Development branch
178+
- Executes unit tests
179+
- Uses .NET 10.0.x SDK
180+
181+
#### AppVeyor Integration
182+
- **`appveyor.yml`**: Legacy CI configuration
183+
- Builds packages and publishes artifacts
184+
- Creates setup executables with Inno Setup
185+
186+
### Testing Strategy
187+
- **Unit Tests**: Located in `*Tests.csproj` projects
188+
- **Test Frameworks**: NUnit with Moq for mocking
189+
- **Test Data**: Located in `TestData/` directories within test projects
190+
- **Coverage**: Focus on core functionality and columnizer plugins
191+
192+
### Dependencies and Libraries
193+
Key external dependencies (managed via Directory.Packages.props):
194+
- **NLog**: Logging framework
195+
- **Newtonsoft.Json**: JSON processing
196+
- **CsvHelper**: CSV file processing
197+
- **SSH.NET**: SFTP file system support
198+
- **DockPanelSuite**: UI docking panels
199+
- **NUnit/Moq**: Testing frameworks
200+
201+
## Agent Guidance
202+
203+
### Making Code Changes
204+
1. **Always build before changing**: Run `./build.ps1 --target Clean Compile Test` to establish baseline
205+
2. **Follow existing patterns**: Study similar implementations in the codebase
206+
3. **Respect architecture**: Use plugin interfaces for extensibility
207+
4. **Code style**: Follow `.editorconfig` rules (extensive configuration provided)
208+
5. **Null safety**: Project uses nullable reference types (`<Nullable>enable</Nullable>`)
209+
210+
### Common Development Tasks
211+
212+
#### Adding New Columnizer
213+
1. Create new project in `src/` directory following naming pattern `*Columnizer`
214+
2. Implement `ILogLineColumnizer` interface from `ColumnizerLib`
215+
3. Add project reference to main solution
216+
4. Add unit tests in corresponding `*Tests` project
217+
218+
#### Modifying UI Components
219+
1. UI components are in `LogExpert.UI` project
220+
2. Follow Windows Forms patterns
221+
3. Be aware of High DPI considerations (documented in README)
222+
4. Test on different Windows versions if possible
223+
224+
#### Adding Dependencies
225+
1. Update `src/Directory.Packages.props` for version management
226+
2. Add `<PackageReference>` in specific project files
227+
3. Ensure compatibility with .NET 10.0 target framework
228+
229+
### Build Troubleshooting
230+
- **Missing Windows SDK**: Ensure Windows development environment
231+
- **Version conflicts**: Check `global.json` and upgrade SDK if needed
232+
- **Plugin loading issues**: Verify plugins are copied to output directory
233+
- **Test failures**: Check test data file paths and Windows-specific assumptions
234+
235+
### Important Notes
236+
- **Windows-only**: This is a Windows-specific application using Windows Forms
237+
- **Plugin architecture**: Extensibility through columnizer and file system plugins
238+
- **Single instance**: Application uses named pipes for IPC between instances
239+
- **Legacy codebase**: Contains patterns from .NET Framework era, being modernized
240+
- **Comprehensive configuration**: Very detailed .editorconfig and analysis rules
241+
242+
### Trust These Instructions
243+
These instructions are comprehensive and tested. Only search for additional information if:
244+
1. Instructions appear incomplete for your specific task
245+
2. You encounter errors not covered in the troubleshooting section
246+
3. You need to understand implementation details not covered here
247+
248+
The build system, project structure, and development patterns described here are accurate as of the current codebase state.

.github/workflows/build_dotnet.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: .NET Core Desktop
2+
3+
on:
4+
# push:
5+
# branches: [ "Development" ]
6+
7+
pull_request:
8+
branches: [ "Development" ]
9+
types: [opened, synchronize]
10+
11+
env:
12+
Solution: src/LogExpert.sln
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
17+
18+
jobs:
19+
build:
20+
permissions:
21+
contents: write # Changed to 'write' for committing
22+
pull-requests: write # Added for PR operations
23+
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
configuration: [Debug, Release]
28+
29+
runs-on: windows-latest
30+
name: Build Application - ${{ matrix.configuration }}
31+
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
token: ${{ secrets.GITHUB_TOKEN }}
38+
ref: ${{ github.head_ref }} # Checkout the PR branch
39+
40+
- name: Install .NET Core
41+
uses: actions/setup-dotnet@v4
42+
with:
43+
dotnet-version: 10.0.x
44+
45+
- name: Build application
46+
run: |
47+
dotnet build ${{ env.Solution }} --nologo -v quiet -c ${{ matrix.configuration }}
48+
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+
67+
- name: Upload artifact
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: Snapshot-${{ matrix.configuration }}
71+
path: bin/${{ matrix.configuration }}
72+
retention-days: 7

.github/workflows/test_dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup .NET
2020
uses: actions/setup-dotnet@v4
2121
with:
22-
dotnet-version: 9.0.x
22+
dotnet-version: 10.0.x
2323
- name: Restore dependencies
2424
run: dotnet restore
2525
working-directory: src

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ paket-files/
322322
# FAKE - F# Make
323323
.fake/
324324

325+
# Nuke Build System
326+
.nuke/*
327+
!.nuke/parameters.json
328+
325329
# CodeRush personal settings
326330
.cr/personal
327331

0 commit comments

Comments
 (0)