Table of Contents

Struct LogRecord

Namespace
OptunaSharp.Logging
Assembly
OptunaSharp.dll

A single log record passed to ILogHandler implementations.

public readonly struct LogRecord
Inherited Members

Constructors

LogRecord(string, int, string, Exception?, DateTime)

Captures a log event and its optional exception.

public LogRecord(string loggerName, int level, string message, Exception? exception, DateTime timestamp)

Parameters

loggerName string

Name of the component that emitted the record.

level int

Numeric logging severity, using the LogLevel constants.

message string

Text to include in the log record.

exception Exception

Optional exception retained for handler formatting.

timestamp DateTime

Local timestamp assigned when the record is created.

Properties

Exception

Gets the associated exception, or null.

public Exception? Exception { get; }

Property Value

Exception

Level

Gets the numeric severity.

public int Level { get; }

Property Value

int

LevelChar

Single-letter level tag, as in Optuna's default formatter (%(levelname)1.1s).

public char LevelChar { get; }

Property Value

char

LoggerName

Gets the name of the emitting logger.

public string LoggerName { get; }

Property Value

string

Message

Gets the event text.

public string Message { get; }

Property Value

string

Timestamp

Gets the local event timestamp.

public DateTime Timestamp { get; }

Property Value

DateTime