Skip to content

Bia10/Bia.LogViewer

Repository files navigation

Bia.LogViewer

.NET C# Build Status codecov License

Reusable Avalonia log viewer control with filtering for .NET applications. Built with SukiUI and Material.Icons.

Cross-platform, trimmable and AOT/NativeAOT compatible.

⭐ Please star this project if you like it. ⭐

Usage | Development

Packages

Package NuGet Description
Bia.LogViewer.Core NuGet Core abstractions: LogModel, ILogEntrySource, IClipboardService
Bia.LogViewer.Avalonia NuGet Avalonia UserControl + LogViewerViewModel with filtering UI

All packages are cross-platform, trimmable and AOT/NativeAOT compatible.

Features

  • Log level filtering — toggle Info, Warning, Error, Critical independently via bitmask
  • Auto-scroll — automatically scrolls to the latest log entry
  • Copy on select — optionally copies selected log message to clipboard
  • Per-level counters — real-time count badges for each severity level
  • Observable source — uses ObservableCollections for high-performance reactive updates

Usage

1. Implement the interfaces

// Provide log entries from your logging pipeline
public class MyLogSource : ILogEntrySource
{
    public IReadOnlyObservableList<LogModel>? Entries { get; }
}

// Platform clipboard integration
public class MyClipboard : IClipboardService
{
    public async Task CopyToClipboardAsync(string? text)
    {
        // Use Avalonia's clipboard API
    }
}

2. Create the ViewModel and bind it

var vm = new LogViewerViewModel(logSource, clipboardService);

3. Use the control in AXAML

<logViewer:LogViewerControl DataContext="{Binding LogViewerVm}" />

Development

dotnet tool restore
dotnet build -c Release
dotnet test
dotnet csharpier format .
dotnet format style
dotnet format analyzers

License

MIT

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages