Table of Contents

Class Logger

Namespace
OptunaSharp.Logging
Assembly
OptunaSharp.dll

A named logger routed through the shared OptunaSharp root logger, mirroring the subset of Python's logging.Logger that Optuna uses.

public sealed class Logger
Inheritance
Logger
Inherited Members

Properties

Name

Gets this logger's component name.

public string Name { get; }

Property Value

string

Methods

Debug(string)

Emits a debug record when permitted by the current verbosity.

public void Debug(string message)

Parameters

message string

Text to include in the log record.

Exceptions

Exception

A registered log handler fails while processing the record.

Error(string)

Emits a error record when permitted by the current verbosity.

public void Error(string message)

Parameters

message string

Text to include in the log record.

Exceptions

Exception

A registered log handler fails while processing the record.

Info(string)

Emits a info record when permitted by the current verbosity.

public void Info(string message)

Parameters

message string

Text to include in the log record.

Exceptions

Exception

A registered log handler fails while processing the record.

IsEnabledFor(int)

Checks whether the shared verbosity threshold permits this severity.

public bool IsEnabledFor(int level)

Parameters

level int

Numeric logging severity, using the LogLevel constants.

Returns

bool

True when the severity meets the threshold and logging is not disabled.

Warning(string)

Emits a warning record when permitted by the current verbosity.

public void Warning(string message)

Parameters

message string

Text to include in the log record.

Exceptions

Exception

A registered log handler fails while processing the record.

Warning(string, Exception?)

Emits a warning record when permitted by the current verbosity.

public void Warning(string message, Exception? exception)

Parameters

message string

Text to include in the log record.

exception Exception

Optional exception retained for handler formatting.

Exceptions

Exception

A registered log handler fails while processing the record.