Class RDCoreConsoleLogger
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
optionsIOptions<SdkServerOptions>Server options — supplies the trace-level floor and the verbose flag.
writerIConsoleMessageWriterThe renderer messages are written to.
Methods
BeginScope<TState>(TState)
Begins a logical operation scope.
public IDisposable BeginScope<TState>(TState state) where TState : notnull
Parameters
stateTStateThe identifier for the scope.
Returns
- IDisposable
An IDisposable that ends the logical operation scope on dispose.
Type Parameters
TStateThe 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
logLevelLogLevel
Returns
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
Log(ConsoleMessageBuilder)
Renders a pre-built message.
public void Log(ConsoleMessageBuilder builder)
Parameters
builderConsoleMessageBuilder
Log(VBApplicationErrorInfo)
Renders an application error.
public void Log(VBApplicationErrorInfo error)
Parameters
errorVBApplicationErrorInfo
Log(VBCompileErrorInfo)
Renders a compile error.
public void Log(VBCompileErrorInfo error)
Parameters
errorVBCompileErrorInfo
Log(VBRuntimeErrorInfo)
Renders a runtime error.
public void Log(VBRuntimeErrorInfo error)
Parameters
errorVBRuntimeErrorInfo
Log(VBSyntaxErrorInfo)
Renders a syntax error.
public void Log(VBSyntaxErrorInfo error)
Parameters
errorVBSyntaxErrorInfo
Log(Exception)
Renders an exception.
public void Log(Exception exception)
Parameters
exceptionException
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
logLevelLogLevelEntry will be written on this level.
eventIdEventIdId of the event.
stateTStateThe entry to be written. Can be also an object.
exceptionExceptionThe exception related to this entry.
formatterFunc<TState, Exception, string>Function to create a string message of the
stateandexception.
Type Parameters
TStateThe type of the object to be written.