diff --git a/idf_build_apps/args.py b/idf_build_apps/args.py index ffa7ce7..e6bc776 100644 --- a/idf_build_apps/args.py +++ b/idf_build_apps/args.py @@ -16,7 +16,6 @@ import os import re import typing as t -import warnings from copy import deepcopy from dataclasses import InitVar, asdict, dataclass, field, fields @@ -141,8 +140,10 @@ def __setattr__(self, key, value): # set together with the deprecated field super().__setattr__(_new_name_deprecated_name_dict[key], value) elif key in _deprecated_name_new_name_dict: - warnings.warn( - f'Field {key} is deprecated by {_deprecated_name_new_name_dict[key]}. Will be removed in the future.' + LOGGER.warning( + 'Field %s is deprecated by %s. Will be removed in the future.', + key, + _deprecated_name_new_name_dict[key], ) super().__setattr__(key, value) # set together with the new field diff --git a/idf_build_apps/manifest/manifest.py b/idf_build_apps/manifest/manifest.py index 39eb186..1531d0e 100644 --- a/idf_build_apps/manifest/manifest.py +++ b/idf_build_apps/manifest/manifest.py @@ -4,7 +4,6 @@ import os import pickle import typing as t -import warnings from hashlib import sha512 from pyparsing import ( @@ -257,7 +256,7 @@ def from_files(cls, paths: t.Iterable[str], *, root_path: str = os.curdir) -> 'M if cls.CHECK_MANIFEST_RULES: raise InvalidManifest(msg) else: - warnings.warn(msg) + LOGGER.warning(msg) _known_folders[rule.folder] = path @@ -290,7 +289,7 @@ def from_file(cls, path: str, *, root_path: str = os.curdir) -> 'Manifest': if cls.CHECK_MANIFEST_RULES: raise InvalidManifest(msg) else: - warnings.warn(msg) + LOGGER.warning(msg) try: rules.append(FolderRule(folder, **folder_rule if folder_rule else {}))