ConsoleLoggerExtensions.AddConsoleFormatter 方法

定义

重载

AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder)

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

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

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

AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder)

Source:
ConsoleLoggerExtensions.cs
Source:
ConsoleLoggerExtensions.cs
Source:
ConsoleLoggerExtensions.cs
Source:
ConsoleLoggerExtensions.cs

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

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

要使用的当前日志记录生成器实例。

返回

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

适用于

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

Source:
ConsoleLoggerExtensions.cs
Source:
ConsoleLoggerExtensions.cs
Source:
ConsoleLoggerExtensions.cs
Source:
ConsoleLoggerExtensions.cs

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

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>

为自定义格式化程序 TFormatter配置 TOptions 的委托。

返回

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

适用于