Simple.Logging.Console 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Simple.Logging.Console --version 1.1.0
                    
NuGet\Install-Package Simple.Logging.Console -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Simple.Logging.Console" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Simple.Logging.Console" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Simple.Logging.Console" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Simple.Logging.Console --version 1.1.0
                    
#r "nuget: Simple.Logging.Console, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Simple.Logging.Console@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Simple.Logging.Console&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Simple.Logging.Console&version=1.1.0
                    
Install as a Cake Tool

Simple log formatter 🌈

A way to simplify console logging from the default C# fancy 2 line logging that provides way too much information for simple applications.

  • Has some simple coloring related to log levels.
  • Has some highlight formatting when placing text between 'single quotes' or `backticks`.
  • Colors are configurable per log level via a LogPalette.

Usage

dotnet add package Simple.Logging.Console

In your startup code

var builder = Host.CreateApplicationBuilder(arguments);
builder.Logging.AddConsoleLogging();

Highlighting

Text wrapped in 'single quotes' is drawn in the level's highlight color; text wrapped in `backticks` is drawn in its accent color. The two delimiters don't nest inside each other — a backtick inside a quoted span (or vice versa) is treated as literal text.

Custom palette

Pass a delegate to AddConsoleLogging to override any of the per-level colors, the timestamp color, the exception color, or the highlight/accent delimiter characters:

builder.Logging.AddConsoleLogging(configurePalette: palette =>
{
    palette.Warning = palette.Warning with { AccentColor = RgbColor.FromHex(0xFF8800) };
    palette.Information = palette.Information with { MessageColor = new RgbColor(0, 200, 255) };
    palette.HighlightDelimiter = '*';
    palette.AccentDelimiter = '~';
});

Every color slot is an ILogColor, implemented by either AnsiColor (implicitly convertible from a standard ConsoleColor, for maximum compatibility) or RgbColor (24-bit truecolor, via its constructor or RgbColor.FromHex(0xRRGGBB)). Truecolor renders correctly on modern ANSI-capable terminals; if output is redirected to a file or viewed through a legacy console, Microsoft.Extensions.Logging.Console's own fallback only recognizes the standard 16 colors, so truecolor escape sequences may appear as raw text there — stick to ConsoleColor if that scenario matters to you.

LogPalette.LikelySupportsTrueColor is a best-effort, static heuristic (COLORTERM, WT_SESSION, NO_COLOR, and whether output is redirected) you can check before building an RGB-heavy palette:

builder.Logging.AddConsoleLogging(configurePalette: palette =>
{
    if (LogPalette.LikelySupportsTrueColor)
        palette.Information = palette.Information with { MessageColor = new RgbColor(0, 200, 255) };
});

There's no way to reliably query a terminal's actual color depth without risking a hang on redirected output, so treat this as a hint, not a guarantee.

Each level's badge background defaults to transparent so it doesn't clash with the terminal's own background; Error and Critical are the exception, keeping a filled block to stand out.

Formerly published as Crude.Logging.Console. That package is deprecated in favor of this one — see the changelog.

Icon

The package icon is a cropped version of "Rainbow Emoji" by EmmanuelCordoliani, used under CC BY-SA 4.0. It is licensed separately from the source code above (see LICENSE.txt); redistributing icon.png itself, modified or not, must keep it under CC BY-SA 4.0 (or a compatible license) with the same attribution.

Package maintainer

https://github.com/svenrog

Changelog

Changelog

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 0 7/10/2026
1.1.0 0 7/10/2026
1.0.1 17 7/9/2026