ConsoleLoggerExtensions.AddConsoleFormatter 方法

定義

多載

AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder)

新增自訂主控台記錄格式器。

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

新增使用指定選項進行設定的自訂主控台記錄格式器。

AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder)

來源:
ConsoleLoggerExtensions.cs
來源:
ConsoleLoggerExtensions.cs
來源:
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>)

來源:
ConsoleLoggerExtensions.cs
來源:
ConsoleLoggerExtensions.cs
來源:
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

傳回

可供鏈結其他呼叫的目前記錄產生器執行個體。

適用於