ConsoleLoggerExtensions.AddConsoleFormatter 方法

定义

重载

AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder)

添加自定义控制台记录器格式化程序。

AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder, Action<TOptions>)

添加一个自定义控制台记录器格式化程序,以使用指定的选项进行配置。

AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder)

添加自定义控制台记录器格式化程序。

public:
generic <typename TFormatter, typename TOptions>
 where TFormatter : Microsoft::Extensions::Logging::Console::ConsoleFormatter where TOptions : Microsoft::Extensions::Logging::Console::ConsoleFormatterOptions[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggingBuilder ^ AddConsoleFormatter(Microsoft::Extensions::Logging::ILoggingBuilder ^ builder);
public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsoleFormatter<TFormatter,TOptions> (this Microsoft.Extensions.Logging.ILoggingBuilder builder) where TFormatter : Microsoft.Extensions.Logging.Console.ConsoleFormatter where TOptions : Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions;
static member AddConsoleFormatter : Microsoft.Extensions.Logging.ILoggingBuilder -> Microsoft.Extensions.Logging.ILoggingBuilder (requires 'Formatter :> Microsoft.Extensions.Logging.Console.ConsoleFormatter and 'Options :> Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions)
<Extension()>
Public Function AddConsoleFormatter(Of TFormatter As ConsoleFormatter, TOptions As ConsoleFormatter) (builder As ILoggingBuilder) As ILoggingBuilder

类型参数

TFormatter

自定义控制台记录器格式化程序。

TOptions

配置选项。

参数

builder
ILoggingBuilder

要使用的最新日志记录生成器实例。

返回

ILoggingBuilder

最新日志记录生成器实例,以便可以链接其他调用。

适用于

AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder, Action<TOptions>)

添加一个自定义控制台记录器格式化程序,以使用指定的选项进行配置。

public:
generic <typename TFormatter, typename TOptions>
 where TFormatter : Microsoft::Extensions::Logging::Console::ConsoleFormatter where TOptions : Microsoft::Extensions::Logging::Console::ConsoleFormatterOptions[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggingBuilder ^ AddConsoleFormatter(Microsoft::Extensions::Logging::ILoggingBuilder ^ builder, Action<TOptions> ^ configure);
public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsoleFormatter<TFormatter,TOptions> (this Microsoft.Extensions.Logging.ILoggingBuilder builder, Action<TOptions> configure) where TFormatter : Microsoft.Extensions.Logging.Console.ConsoleFormatter where TOptions : Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions;
static member AddConsoleFormatter : Microsoft.Extensions.Logging.ILoggingBuilder * Action<'Options (requires 'Options :> Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions)> -> Microsoft.Extensions.Logging.ILoggingBuilder (requires 'Formatter :> Microsoft.Extensions.Logging.Console.ConsoleFormatter and 'Options :> Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions)
<Extension()>
Public Function AddConsoleFormatter(Of TFormatter As ConsoleFormatter, TOptions As ConsoleFormatter) (builder As ILoggingBuilder, configure As Action(Of TOptions)) As ILoggingBuilder

类型参数

TFormatter

自定义控制台记录器格式化程序。

TOptions

配置选项。

参数

builder
ILoggingBuilder

要使用的最新日志记录生成器实例。

configure
Action<TOptions>

用于配置自定义格式化程序 TFormatterTOptions 的委托。

返回

ILoggingBuilder

最新日志记录生成器实例,以便可以链接其他调用。

适用于