Skip to content

Commit

Permalink
Modify LoggingHandler.__init__(): Replace log_emitter arg with log_em…
Browse files Browse the repository at this point in the history
…itter_provider, Obtain log_emitter via log_emitter_provider
  • Loading branch information
pranavmarla committed Aug 6, 2022
1 parent fcb7561 commit b1d7495
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions opentelemetry-sdk/src/opentelemetry/sdk/_logs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b1d7495

Please sign in to comment.