XenoAtom.Logging.Terminal
1.0.0-preview.2
Prefix Reserved
See the version list below for details.
dotnet add package XenoAtom.Logging.Terminal --version 1.0.0-preview.2
NuGet\Install-Package XenoAtom.Logging.Terminal -Version 1.0.0-preview.2
<PackageReference Include="XenoAtom.Logging.Terminal" Version="1.0.0-preview.2" />
<PackageVersion Include="XenoAtom.Logging.Terminal" Version="1.0.0-preview.2" />
<PackageReference Include="XenoAtom.Logging.Terminal" />
paket add XenoAtom.Logging.Terminal --version 1.0.0-preview.2
#r "nuget: XenoAtom.Logging.Terminal, 1.0.0-preview.2"
#:package XenoAtom.Logging.Terminal@1.0.0-preview.2
#addin nuget:?package=XenoAtom.Logging.Terminal&version=1.0.0-preview.2&prerelease
#tool nuget:?package=XenoAtom.Logging.Terminal&version=1.0.0-preview.2&prerelease
XenoAtom.Logging

<img align="right" width="256px" height="256px" src="https://raw.githubusercontent.com/XenoAtom/XenoAtom.Logging/main/img/XenoAtom.Logging.png">
XenoAtom.Logging is a high-performance structured logging runtime for .NET, designed for zero allocations on the hot path and predictable throughput in both sync and async modes. It includes a high-efficiency interpolated logging API, structured properties/scopes, source-generated formatters, and production-grade file/JSON sinks.
This library is pre-1.0. The API is largely stable but may still see breaking changes.
Requirements (.NET 10 / C# 14)
XenoAtom.Logging targets net10.0 and requires the .NET 10 SDK (C# 14).
Installation
dotnet add package XenoAtom.Logging
dotnet add package XenoAtom.Logging.Terminal
✨ Features
- Performance-first (zero allocations on the hot path):
- Allocation-aware interpolated-string handlers (
Trace/Debug/Info/Warn/Error/Fatal) - Formatting into
Span<char>with pooled buffers and optional segment metadata
- Allocation-aware interpolated-string handlers (
- Sync by default, async when you need it:
- Default processor is synchronous (
LogMessageSyncProcessor) - Optional async processor (
LogMessageAsyncProcessor) with bounded queue and overflow policy (Drop,DropAndNotify,Block,Allocate)
- Default processor is synchronous (
- Structured logging:
- Per-message properties (
LogProperties) - Scopes (
BeginScope) captured as snapshots
- Per-message properties (
- Template-driven text formatting (source generation):
LogFormatterbase class with shared settings (LevelFormat,TimestampFormat)- Generated template formatters (e.g.
StandardLogFormatter) and segment kinds for rich sinks
- Terminal integration without
System.Console:XenoAtom.Logging.TerminalusesXenoAtom.Terminalfor markup-aware outputTerminalLogControlWritertargetsXenoAtom.Terminal.UI.Controls.LogControlfor fullscreen/log-viewer apps- Visual attachments: log calls can attach
XenoAtom.Terminal.UI.Visual(tables, layouts, rich widgets) - Terminal docs: https://xenoatom.github.io/terminal
- Production file and JSON sinks:
- Rolling + retention (
FileLogWriter,JsonFileLogWriter) - Failure policies and durability options
- Rolling + retention (
- Operational support:
- Runtime diagnostics via
LogManager.GetDiagnostics() - NativeAOT and trimming oriented (
IsAotCompatible,IsTrimmable)
- Runtime diagnostics via

And the integration with LogControl:

XenoAtom.Logging does not aim to be compatible with Microsoft.Extensions.Logging today. A bridge may be added later, but the runtime is designed to stand on its own.
Package layout
XenoAtom.Logging: core runtime, formatters, stream/file/JSON writersXenoAtom.Loggingalso ships the generators/analyzers in-package (analyzers/dotnet/cs)XenoAtom.Logging.Terminal: terminal sink usingXenoAtom.TerminalandXenoAtom.Terminal.UI
🚀 Quick start
using XenoAtom.Logging;
using XenoAtom.Logging.Writers;
var config = new LogManagerConfig
{
RootLogger =
{
MinimumLevel = LogLevel.Info,
Writers =
{
new FileLogWriter(
new FileLogWriterOptions("logs/app.log")
{
FileSizeLimitBytes = 10 * 1024 * 1024,
RollingInterval = FileRollingInterval.Daily,
RetainedFileCountLimit = 7
})
}
}
};
LogManager.Initialize(config); // sync processor by default
var logger = LogManager.GetLogger("Sample");
logger.Info($"Hello {42}");
LogManager.Shutdown();
Enable async processing:
LogManager.Initialize<LogMessageAsyncProcessor>(config);
🖥️ Terminal markup and visuals
Markup payload logging (terminal sink):
logger.InfoMarkup("[green]ready[/]");
logger.ErrorMarkup($"[bold red]failed[/] id={requestId}");
Visual attachments via XenoAtom.Terminal.UI (rendered under the log line by TerminalLogWriter):
using XenoAtom.Terminal.UI;
using XenoAtom.Terminal.UI.Controls;
var table = new Table()
.Headers("Step", "Status", "Duration")
.AddRow("Initialize", "OK", "00:00.045")
.AddRow("ProcessRequest", "FAILED", "00:00.003");
logger.Info(table, "Run summary");
logger.InfoMarkup(table, "[bold]Run summary (styled)[/]");
TerminalLogWriter and TerminalLogControlWriter both expose Styles and SegmentStyleResolver for per-segment and per-level styling.
Thread safety
LogManagerandLoggerare safe for concurrent logging.- Configure
LogManagerConfig,LoggerConfig.Writers, and writer filter collections from a single thread, then callApplyChanges()when done. LogPropertiesis a mutable value type; avoid copying populated instances and dispose only the owner instance.
See doc/thread-safety.md for detailed guidance.
📖 Documentation
- User guide:
doc/readme.md - Template-based log formatters:
doc/log-formatter.md - Terminal sink and visuals:
doc/terminal.md,doc/terminal-visuals.md - File and JSON writers:
doc/file-writer.md - Benchmarks:
doc/benchmarks.md - Source-generated logging (
[LogMethod]):doc/source-generator.md - Samples:
samples/readme.md- Includes
HelloLogControl(fullscreenLogControl+ background logging demo)
- Includes
🪪 License
This software is released under the BSD-2-Clause license.
🤗 Author
Alexandre Mutel aka xoofx.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- XenoAtom.Logging (>= 1.0.0-preview.2)
- XenoAtom.Terminal.UI (>= 1.0.0-preview.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on XenoAtom.Logging.Terminal:
| Repository | Stars |
|---|---|
|
lunet-io/lunet
A fast, modular static website generator
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.2 | 397 | 3/1/2026 |
| 1.1.1 | 109 | 2/20/2026 |
| 1.1.0 | 178 | 2/19/2026 |
| 1.0.2 | 152 | 2/14/2026 |
| 1.0.1 | 95 | 2/14/2026 |
| 1.0.0 | 108 | 2/13/2026 |
| 1.0.0-preview.5 | 57 | 2/10/2026 |
| 1.0.0-preview.4 | 48 | 2/10/2026 |
| 1.0.0-preview.3 | 47 | 2/10/2026 |
| 1.0.0-preview.2 | 51 | 2/9/2026 |
| 1.0.0-preview.1 | 48 | 2/9/2026 |