Table of Contents

Class MessageLogger

Namespace
DuetControlServer.Utility
Assembly
DuetControlServer.dll

Logger that outputs messages to the object model

public sealed class MessageLogger : ILogger
Inheritance
MessageLogger
Implements
Inherited Members

Constructors

MessageLogger(string, ObjectModel, LogLevel)

Constructor

public MessageLogger(string categoryName, ObjectModel model, LogLevel minimumLevel)

Parameters

categoryName string
model ObjectModel
minimumLevel LogLevel

Methods

BeginScope<TState>(TState)

Begin a scope

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

Parameters

state TState

Returns

IDisposable

Type Parameters

TState

IsEnabled(LogLevel)

Check if log level is enabled

public bool IsEnabled(LogLevel logLevel)

Parameters

logLevel LogLevel

Returns

bool

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

Log a message

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

Parameters

logLevel LogLevel
eventId EventId
state TState
exception Exception
formatter Func<TState, Exception, string>

Type Parameters

TState