Skip to content

verticalsoftware/vertical-spectreconsolelogger

Repository files navigation

vertical-spectreconsolelogger

A seriously customizable Spectre Console provider for Microsoft.Extensions.Logging. Don't change how your app logs - change how the logs are presented.

.net GitHub Package info

Dev build codecov Pre release Release

Quick Start

Add a package reference to your .csproj file:

$ dotnet add package vertical-spectreconsolelogger --prerelease

Call AddSpectreConsole in your logging setup:

var loggerFactory = LoggerFactory.Create(builder => builder
    .AddSpectreConsole());

var logger = loggerFactory.CreateLogger("MyLogger");

logger.LogInformation("Hello world!");

Features at a glance

  1. Decouples styling and formatting from logging (e.g. don't change your logging, customize how the events are displayed).
  2. Define different customizations for each log level.
  3. Customize the styling and formatting of specific values or specific types of values.
  4. Destructure and output complex types in JSON(ish) notation.
  5. Customize the rendering completely using output templates.
  6. Extend the logger with your own renderers.

Format/style log values

cap-1

Destructured output follows configuration

cap-2

Precisely control exception output

cap-3

Documentation

Read the full docs here.

About

Microsoft ILogger implementation for Spectre console

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published