Skip to content

Commit

Permalink
fix logged method function/method signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
RHammond2 committed Mar 4, 2024
1 parent 0c52c93 commit b09c1e0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions openoa/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import logging.config
from pathlib import Path
from functools import wraps


def setup_logging(
Expand All @@ -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}")
Expand All @@ -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}")
Expand Down

0 comments on commit b09c1e0

Please sign in to comment.