From b1d749559d2c100c01be78132546fd9e07f7591c Mon Sep 17 00:00:00 2001 From: Pranav Marla Date: Fri, 5 Aug 2022 20:36:15 -0400 Subject: [PATCH] Modify LoggingHandler.__init__(): Replace log_emitter arg with log_emitter_provider, Obtain log_emitter via log_emitter_provider --- opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py b/opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py index e0439a3d278..6a4d2153f7f 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py @@ -311,10 +311,11 @@ class LoggingHandler(logging.Handler): def __init__( self, level=logging.NOTSET, - log_emitter=None, + log_emitter_provider=None, ) -> None: super().__init__(level=level) - self._log_emitter = log_emitter or get_log_emitter(__name__) + self._log_emitter_provider = log_emitter_provider or get_log_emitter_provider() + self._log_emitter = get_log_emitter(__name__, log_emitter_provider=self._log_emitter_provider) @staticmethod def _get_attributes(record: logging.LogRecord) -> Attributes: