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
loggerNamestringName of the component that emitted the record.
levelintNumeric logging severity, using the LogLevel constants.
messagestringText to include in the log record.
exceptionExceptionOptional exception retained for handler formatting.
timestampDateTimeLocal timestamp assigned when the record is created.
Properties
Exception
Gets the associated exception, or null.
public Exception? Exception { get; }
Property Value
Level
Gets the numeric severity.
public int Level { get; }
Property Value
LevelChar
Single-letter level tag, as in Optuna's default formatter (%(levelname)1.1s).
public char LevelChar { get; }
Property Value
LoggerName
Gets the name of the emitting logger.
public string LoggerName { get; }
Property Value
Message
Gets the event text.
public string Message { get; }
Property Value
Timestamp
Gets the local event timestamp.
public DateTime Timestamp { get; }