From 0534a5849a90d58c6989516185e04701f363273b Mon Sep 17 00:00:00 2001 From: Valeriy Date: Mon, 28 Apr 2025 09:50:56 +0500 Subject: [PATCH] Added fallback to original logger --- log_with_context/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/log_with_context/__init__.py b/log_with_context/__init__.py index 41d9754..519b5f1 100644 --- a/log_with_context/__init__.py +++ b/log_with_context/__init__.py @@ -142,6 +142,10 @@ def exception(self, msg: Any, *args: Any, **kwargs: Any) -> None: """Exception.""" return self._msg(self.base_logger.exception, msg, *args, **kwargs) + def __getattr__(self, name): + """get attribute of base logger in case object of this class have nu such attribute""" + return getattr(self.base_logger, name) + class add_logging_context: """