ConsoleLoggerExtensions.AddConsoleFormatter 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder) |
新增自定義主控台記錄器格式器 'TFormatter',以選項 'TOptions' 進行設定。 |
AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder, Action<TOptions>) |
新增自定義主控台記錄器格式器 'TFormatter',以選項 'TOptions' 進行設定。 |
AddConsoleFormatter<TFormatter,TOptions>(ILoggingBuilder)
新增自定義主控台記錄器格式器 'TFormatter',以選項 '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);
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>)
新增自定義主控台記錄器格式器 'TFormatter',以選項 '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
要使用的 ILoggingBuilder。
- configure
- Action<TOptions>
委派,用來設定自定義格式子 『TFormatter』 的選項 『TOptions』。
傳回
目前的記錄產生器實例,以便鏈結其他呼叫。