Skip to content

Commit

Permalink
fix logging for module-level functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ljeub-pometry committed Nov 18, 2024
1 parent f76d7ab commit e1bbc2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/scripts/gen-stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down

0 comments on commit e1bbc2f

Please sign in to comment.