Table of Contents

Class OptunaLogging

Namespace
OptunaSharp.Logging
Assembly
OptunaSharp.dll

Port of optuna/logging.py — controls the verbosity of OptunaSharp's library-root logger.

public static class OptunaLogging
Inheritance
OptunaLogging
Inherited Members

Methods

AddHandler(ILogHandler)

Add a custom handler (the seam external logging adapters — e.g. the Tier X Microsoft.Extensions.Logging bridge — plug into). A handler already registered is not added again, so it receives each record once, as Python's Logger.addHandler ensures.

public static void AddHandler(ILogHandler handler)

Parameters

handler ILogHandler

Handler instance to register or unregister; its lifetime remains caller-owned.

DisableDefaultHandler()

Disable the default handler of the OptunaSharp's root logger.

public static void DisableDefaultHandler()

EnableDefaultHandler()

Enable the default handler of the OptunaSharp's root logger.

public static void EnableDefaultHandler()

GetLogger(string)

Return a logger with the specified name.

This function is not supposed to be directly accessed by library users.

public static Logger GetLogger(string name)

Parameters

name string

Component logger name; this does not create an independent threshold.

Returns

Logger

A named logger sharing the library-wide threshold and handlers.

GetVerbosity()

Return the current level for the OptunaSharp's root logger.

public static int GetVerbosity()

Returns

int

Current numeric library-wide severity threshold.

RemoveHandler(ILogHandler)

Remove a previously added handler.

public static void RemoveHandler(ILogHandler handler)

Parameters

handler ILogHandler

Handler instance to register or unregister; its lifetime remains caller-owned.

SetVerbosity(int)

Set the level for the OptunaSharp's root logger.

public static void SetVerbosity(int verbosity)

Parameters

verbosity int

Library-wide threshold; NotSet disables emission in this implementation.