Skip to content
Snippets Groups Projects
Commit 4d44f898 authored by Valentin Simon Lüdke's avatar Valentin Simon Lüdke
Browse files

Change log_arguments to use the file logger of the function

parent 557c487d
No related branches found
No related tags found
2 merge requests!14Improve logging,!8Draft: Resolve "Pre-Proc: incorporate tools for creating global setups"
...@@ -77,7 +77,7 @@ def log_arguments(): ...@@ -77,7 +77,7 @@ def log_arguments():
signature = inspect.signature(func) signature = inspect.signature(func)
bound_args = signature.bind(*args, **kwargs) bound_args = signature.bind(*args, **kwargs)
bound_args.apply_defaults() bound_args.apply_defaults()
logger = logging.getLogger(inspect.getmodule(func).__name__)
# Extract arguments and filter out None values # Extract arguments and filter out None values
non_none_args = {k: v for k, v in bound_args.arguments.items() if v is not None} non_none_args = {k: v for k, v in bound_args.arguments.items() if v is not None}
...@@ -85,7 +85,7 @@ def log_arguments(): ...@@ -85,7 +85,7 @@ def log_arguments():
msg = f"Function '{func.__name__}' called with the following arguments: \n" msg = f"Function '{func.__name__}' called with the following arguments: \n"
for arg, value in non_none_args.items(): for arg, value in non_none_args.items():
msg += f" {arg}: {value} \n" msg += f" {arg}: {value} \n"
logger.info(msg) logger.debug(msg)
# Call the original function # Call the original function
return func(*args, **kwargs) return func(*args, **kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment