From 9f4c4584dad02376437c09b7c448c8a8864023c8 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Mon, 1 Apr 2024 18:34:03 +0100 Subject: [PATCH] fix(WVD): Move log out of loop to save performance --- devine/commands/wvd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devine/commands/wvd.py b/devine/commands/wvd.py index 47f4927..1f52ad9 100644 --- a/devine/commands/wvd.py +++ b/devine/commands/wvd.py @@ -120,6 +120,8 @@ def dump(wvd_paths: list[Path], out_dir: Path) -> None: If the path is relative, with no file extension, it will dump the WVD in the WVDs directory. """ + log = logging.getLogger("wvd") + if wvd_paths == (): wvd_paths = list(config.directories.wvds.iterdir()) for wvd_path, out_path in zip(wvd_paths, (out_dir / x.stem for x in wvd_paths)): @@ -133,7 +135,6 @@ def dump(wvd_paths: list[Path], out_dir: Path) -> None: device = Device.load(wvd_path) - log = logging.getLogger("wvd") log.info(f"Dumping: {wvd_path}") log.info(f"L{device.security_level} {device.system_id} {device.type.name}") log.info(f"Saving to: {out_path}")