public sealed class GoogleCloudConsoleFormatter : ConsoleFormatter, IDisposableReference documentation and code samples for the Google.Cloud.Logging.Console class GoogleCloudConsoleFormatter.
Console formatter for use with Google Cloud Logging.
Implements
IDisposableNamespace
Google.Cloud.Logging.ConsoleAssembly
Google.Cloud.Logging.Console.dll
Constructors
GoogleCloudConsoleFormatter(IOptionsMonitor<GoogleCloudConsoleFormatterOptions>)
public GoogleCloudConsoleFormatter(IOptionsMonitor<GoogleCloudConsoleFormatterOptions> optionsMonitor)Constructs a new formatter which uses the specified monitor to retrieve options and watch for options changes.
| Parameter | |
|---|---|
| Name | Description |
optionsMonitor |
IOptionsMonitorGoogleCloudConsoleFormatterOptionsThe monitor to observe for changes in options. Must not be null. |
Properties
FormatterName
public static string FormatterName { get; }The name for the Google Cloud console formatter.
| Property Value | |
|---|---|
| Type | Description |
string |
|
Methods
Write<TState>(in LogEntry<TState>, IExternalScopeProvider, TextWriter)
public override void Write<TState>(in LogEntry<TState> logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter)Writes the log message to the specified TextWriter.
| Parameters | |
|---|---|
| Name | Description |
logEntry |
LogEntryThe log entry. |
scopeProvider |
IExternalScopeProviderThe provider of scope data. |
textWriter |
TextWriterThe string writer embedding ansi code for colors. |
| Type Parameter | |
|---|---|
| Name | Description |
TState |
The type of the object to be written. |
if the formatter wants to write colors to the console, it can do so by embedding ANSI color codes into the string