From e1bbc2ff2c260c4b77fd684ec718e1953cfb11cf Mon Sep 17 00:00:00 2001 From: Lucas Jeub Date: Mon, 18 Nov 2024 11:48:28 +0100 Subject: [PATCH] fix logging for module-level functions --- python/scripts/gen-stubs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/scripts/gen-stubs.py b/python/scripts/gen-stubs.py index c61252527..f8f51825d 100755 --- a/python/scripts/gen-stubs.py +++ b/python/scripts/gen-stubs.py @@ -348,9 +348,9 @@ def gen_class(cls: type, name) -> str: def gen_module(module: ModuleType, name: str, path: Path, log_path) -> None: global logger + global fn_logger objs = list(vars(module).items()) objs.sort(key=lambda x: x[0]) - stubs: List[str] = [] modules: List[(ModuleType, str)] = [] path = path / name @@ -359,6 +359,7 @@ def gen_module(module: ModuleType, name: str, path: Path, log_path) -> None: if isinstance(obj, type) and from_raphtory(obj, name): stubs.append(gen_class(obj, obj_name)) elif isinstance(obj, BuiltinFunctionType): + fn_logger = logger.getChild(obj_name) stubs.append(gen_fn(obj, obj_name)) elif isinstance(obj, ModuleType) and obj.__loader__ is None: modules.append((obj, obj_name))