Table of Contents

Class RDCoreConsoleLogger

Namespace
RDCore.SDK.ConsoleIO
Assembly
RDCore.SDK.dll

Renders ILogger calls as structured console messages through an IConsoleMessageWriter.

public class RDCoreConsoleLogger : IRDCoreLogger, ILogger
Inheritance
RDCoreConsoleLogger
Implements
Inherited Members

Constructors

RDCoreConsoleLogger(IOptions<SdkServerOptions>, IConsoleMessageWriter)

Renders ILogger calls as structured console messages through an IConsoleMessageWriter.

public RDCoreConsoleLogger(IOptions<SdkServerOptions> options, IConsoleMessageWriter writer)

Parameters

options IOptions<SdkServerOptions>

Server options — supplies the trace-level floor and the verbose flag.

writer IConsoleMessageWriter

The renderer messages are written to.

Methods

BeginScope<TState>(TState)

Begins a logical operation scope.

public IDisposable BeginScope<TState>(TState state) where TState : notnull

Parameters

state TState

The identifier for the scope.

Returns

IDisposable

An IDisposable that ends the logical operation scope on dispose.

Type Parameters

TState

The type of the state to begin scope for.

IsEnabled(LogLevel)

Enabled when logLevel is at least as severe as the configured TraceLevel floor (and neither is None).

public bool IsEnabled(LogLevel logLevel)

Parameters

logLevel LogLevel

Returns

bool

Log(LogLevel, string, string, string)

Renders a message at level with an explicit title and verbose text.

public void Log(LogLevel level, string title, string message, string verbose)

Parameters

level LogLevel
title string
message string
verbose string

Log(ConsoleMessageBuilder)

Renders a pre-built message.

public void Log(ConsoleMessageBuilder builder)

Parameters

builder ConsoleMessageBuilder

Log(VBApplicationErrorInfo)

Renders an application error.

public void Log(VBApplicationErrorInfo error)

Parameters

error VBApplicationErrorInfo

Log(VBCompileErrorInfo)

Renders a compile error.

public void Log(VBCompileErrorInfo error)

Parameters

error VBCompileErrorInfo

Log(VBRuntimeErrorInfo)

Renders a runtime error.

public void Log(VBRuntimeErrorInfo error)

Parameters

error VBRuntimeErrorInfo

Log(VBSyntaxErrorInfo)

Renders a syntax error.

public void Log(VBSyntaxErrorInfo error)

Parameters

error VBSyntaxErrorInfo

Log(Exception)

Renders an exception.

public void Log(Exception exception)

Parameters

exception Exception

Log<TState>(LogLevel, EventId, TState, Exception?, Func<TState, Exception?, string>)

Writes a log entry.

public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception? exception, Func<TState, Exception?, string> formatter)

Parameters

logLevel LogLevel

Entry will be written on this level.

eventId EventId

Id of the event.

state TState

The entry to be written. Can be also an object.

exception Exception

The exception related to this entry.

formatter Func<TState, Exception, string>

Function to create a string message of the state and exception.

Type Parameters

TState

The type of the object to be written.