From b09c1e0ad7be9d8cf04176da1131f8914913d075 Mon Sep 17 00:00:00 2001 From: RHammond2 <13874373+RHammond2@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:32:58 -0800 Subject: [PATCH] fix logged method function/method signatures --- openoa/logging.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openoa/logging.py b/openoa/logging.py index 242a3dfb..003009c6 100644 --- a/openoa/logging.py +++ b/openoa/logging.py @@ -3,6 +3,7 @@ import logging import logging.config from pathlib import Path +from functools import wraps def setup_logging( @@ -25,6 +26,7 @@ def setup_logging( def logged_method_call(the_method, msg="call"): + @wraps(the_method) def _wrapper(self, *args, **kwargs): logger = logging.getLogger(the_method.__module__) logger.debug(f"{self.__class__.__name__}#{id(self)}.{the_method.__name__}: {msg}") @@ -35,6 +37,7 @@ def _wrapper(self, *args, **kwargs): def logged_function_call(the_function, msg="call"): + @wraps(the_function) def _wrapper(*args, **kwargs): logger = logging.getLogger(the_function.__module__) logger.debug(f"{the_function.__name__}: {msg}")