Delay string interpolations at logging calls

This is a general best practice which brings (slight) performance
improvements and also structured logging.

Enable the hacking check to enforce it.

Change-Id: I1cc4ed756f044c2bb564e091c6474b2894583bed
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2025-12-03 23:14:20 +09:00
parent 1b97a87e00
commit ee5cead310
2 changed files with 3 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ OnMissingEntrypointsCallbackT = Callable[[Iterable[str]], None]
def warning_on_missing_entrypoint(missing_names: Iterable[str]) -> None:
LOG.warning('Could not load {}'.format(', '.join(missing_names)))
LOG.warning('Could not load %s', ', '.join(missing_names))
class NamedExtensionManager(ExtensionManager[T]):

View File

@@ -48,6 +48,8 @@ commands = bindep test
usedevelop = False
[flake8]
# H904: Delay string interpolations at logging calls
enable-extensions = H904
ignore = E251,H405,W504
show-source = True
exclude = .venv,.tox,dist,doc,releasenotes,*egg,build