ConsoleLoggerExtensions.AddConsoleFormatter 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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
要使用的最新日志记录生成器实例。
返回
最新日志记录生成器实例,以便可以链接其他调用。
适用于
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>
用于配置自定义格式化程序 TFormatter
的 TOptions
的委托。
返回
最新日志记录生成器实例,以便可以链接其他调用。