Skip to content
ConsoleMonster
Class

ConsoleMonsterLoggingExtensions

ConsoleMonster.Extensions.Logging

Namespace
ConsoleMonster.Extensions.Logging
Assembly
ConsoleMonster.Extensions.Logging
Modifiers
static

Adds the ConsoleMonster logging provider to a logging builder.

Inheritance

  • object
  • ConsoleMonsterLoggingExtensions

Methods

AddConsoleMonster 2 overloads
public static ILoggingBuilder AddConsoleMonster(ILoggingBuilder builder, Action<ConsoleMonsterLoggerOptions>? configure = null) #

Adds the ConsoleMonster provider: entries with ConsoleMonster's level tags and colours, a timestamp, category and scopes; into a running dashboard's log region when there is one, as lines otherwise (plain when redirected). The provider is added once: a second call keeps the first call's options.

Parameters

builder Microsoft.Extensions.Logging.ILoggingBuilder required
The logging builder.
configure System.Action<ConsoleMonster.Extensions.Logging.ConsoleMonsterLoggerOptions>? = null optional
Changes the options, or null for the defaults.

Returns

ILoggingBuilder The builder.
public static ILoggerFactory AddConsoleMonster(ILoggerFactory factory, Action<ConsoleMonsterLoggerOptions>? configure = null) #

Adds the ConsoleMonster provider to a logger factory (without dependency injection).

Parameters

factory Microsoft.Extensions.Logging.ILoggerFactory required
The logger factory.
configure System.Action<ConsoleMonster.Extensions.Logging.ConsoleMonsterLoggerOptions>? = null optional
Changes the options, or null for the defaults.

Returns

ILoggerFactory The factory.