Add flake8-logging (LOG) and flake8-logging-format (G) for ruff (#1104)

Enables rules LOG (flake8-logging) and G (flake8-logging-format) for
ruff. This will catch eager log message formatting, among other similar
issues.
This commit is contained in:
Teemu R.
2024-08-30 16:13:14 +02:00
committed by GitHub
parent 2706e9a5be
commit 3e43781bb2
11 changed files with 33 additions and 26 deletions

View File

@@ -84,8 +84,11 @@ async def _connect(config: DeviceConfig, protocol: BaseProtocol) -> Device:
if debug_enabled:
end_time = time.perf_counter()
_LOGGER.debug(
f"Device {config.host} with connection params {has_params} "
+ f"took {end_time - start_time:.2f} seconds to {perf_type}",
"Device %s with connection params %s took %.2f seconds to %s",
config.host,
has_params,
end_time - start_time,
perf_type,
)
start_time = time.perf_counter()