Skip to content

Commit

Permalink
fix(composer-model): enhance debug logs with verbosity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Aug 2, 2023
1 parent 37ddc7e commit 08b582c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/hyfi/composer/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def validate_model_config_before(cls, data):
# logger.debug("Validating model config before validating each field.")
_auto_populate_ = data.get("_auto_populate_", getattr(cls._auto_populate_, "default", False)) # type: ignore
if not _auto_populate_:
logger.debug("Auto-populate is disabled.")
if global_hyfi.verbose > 1:
logger.debug("Auto-populate is disabled for class `%s`.", cls.__name__)
return data
_config_name_ = data.get("_config_name_", getattr(cls._config_name_, "default", "__init__")) # type: ignore
_config_group_ = data.get("_config_group_", getattr(cls._config_group_, "default")) # type: ignore
Expand All @@ -56,12 +57,13 @@ def validate_model_config_before(cls, data):
logger.debug("There is no config group specified.")
return data
# Initialize the config with the given config_name.
logger.debug(
"Composing `%s` class with `%s` config in `%s` group.",
_class_name_,
_config_name_,
_config_group_,
)
if global_hyfi.verbose > 0:
logger.debug(
"Composing `%s` class with `%s` config in `%s` group.",
_class_name_,
_config_name_,
_config_group_,
)
config_group = f"{_config_group_}={_config_name_}"
cfg = Composer(
config_group=config_group,
Expand Down

0 comments on commit 08b582c

Please sign in to comment.