Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log level of _optuna_logger not in sync with Optuna's logger #20

Open
contramundum53 opened this issue Apr 13, 2022 · 1 comment
Open
Labels
contribution-welcome This issue welcomes contributions.

Comments

@contramundum53
Copy link
Member

In kurobako/solver/optuna.py, _optuna_logger is used for outputting optimization progress. However, although _optuna_logger is created with optuna.logging.getLogger(__name__), the __name__ does not belong in optuna, returning a separate logger from Optuna's logging system. Thus _optuna_logger's log level does not change by optuna.logging._configure_library_root_logger().

This results in invisible logs when the trials are pruned, because no handler is set for _optuna_logger's info level. When a trial succeeds, _study._log_completed_trial is called, which in turn calls logger created inside Optuna, thus the log is outputted. However, this is not a good design either, because _log_completed_trial is a private member and is subject to future change.

We suggest the following changes:

  • Propagate logs to the root logger, so that the library users can set the handlers themselves
  • Define a custom log format on successful trials and remove the dependency on _study._log_completed_trial
@contramundum53
Copy link
Member Author

#19 has some discussion about this.

@contramundum53 contramundum53 added the contribution-welcome This issue welcomes contributions. label May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution-welcome This issue welcomes contributions.
Projects
None yet
Development

No branches or pull requests

1 participant