internal static ILoggingBuilder AddConsoleWithFormatter <TOptions>(this ILoggingBuilder builder, string name, Action <TOptions> configure) where TOptions : ConsoleFormatterOptions { ThrowHelper.ThrowIfNull(configure); builder.AddFormatterWithName(name); builder.Services.Configure(configure); return(builder); }
internal static ILoggingBuilder AddConsoleWithFormatter <TOptions>(this ILoggingBuilder builder, string name, Action <TOptions> configure) where TOptions : ConsoleFormatterOptions { if (configure == null) { throw new ArgumentNullException(nameof(configure)); } builder.AddFormatterWithName(name); builder.Services.Configure(configure); return(builder); }
/// <summary> /// Add a console log formatter named 'json' to the factory with default properties. /// </summary> /// <param name="builder">The <see cref="ILoggingBuilder"/> to use.</param> public static ILoggingBuilder AddJsonConsole(this ILoggingBuilder builder) => builder.AddFormatterWithName(ConsoleFormatterNames.Json);
/// <summary> /// Add the default console log formatter named 'simple' to the factory with default properties. /// </summary> /// <param name="builder">The <see cref="ILoggingBuilder"/> to use.</param> public static ILoggingBuilder AddSimpleConsole(this ILoggingBuilder builder) => builder.AddFormatterWithName(ConsoleFormatterNames.Simple);
/// <summary> /// Add a console log formatter named 'systemd' to the factory with default properties. /// </summary> /// <param name="builder">The <see cref="ILoggingBuilder"/> to use.</param> public static ILoggingBuilder AddSystemdConsole(this ILoggingBuilder builder) => builder.AddFormatterWithName(ConsoleFormatterNames.Systemd);
/// <summary> /// Add the default textblock log formatter named 'simple' to the factory with default properties. /// </summary> /// <param name="builder">The <see cref="ILoggingBuilder"/> to use.</param> /// <returns>The <see cref="ILoggingBuilder"/> so that additional calls can be chained.</returns> public static ILoggingBuilder AddSimpleTextBlock(this ILoggingBuilder builder) => builder.AddFormatterWithName(SimpleTextBlockFormatter.DefaultName);
public static ILoggingBuilder AddDefaultAnsiConsole(this ILoggingBuilder builder) => builder.AddFormatterWithName(ConsoleFormatterNames.Default);