Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix logging nuisances that can arise when importing flaml
Previously, FLAML would automatically set its own loglevel when imported, overriding any other logging settings that may previously have been set by users of the library. FLAML will now check whether a loglevel has been explicitly set before setting its own. In addition, the `flaml.automl` warning is now emitted using `warnings` rather than `logging.warning`. This falls more in line with other FLAML submodules (e.g. `flaml.ml`). Taken in conjunction, these two changes make it a lot easier for downstream users to suppress warnings emitted by FLAML upon importing the library, either by configuring logging prior to importing `flaml` or by using the somewhat more idiomatic ``` with warnings.catch_warnings(action="ignore"): import flaml ``` This change also helps to ensure that FLAML's defaults won't override users' explicit logging settings.
- Loading branch information