Skip to content

Commit 18260e4

Browse files
committed
Don't use warnings.deprecated - too new
1 parent 340b226 commit 18260e4

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

opentelemetry-sdk/src/opentelemetry/sdk/_configuration/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,11 @@ def _init_logging(
326326
set_event_logger_provider(event_logger_provider)
327327

328328
if setup_logging_handler:
329-
warnings.deprecated(
330-
"Setting the OTel Logging handler from the SDK and the `OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED` are deprecated. You should install the opentelemetry-instrumentation-logging"
329+
warnings.warn(
330+
"Setting the OTel Logging handler from the SDK and the "
331+
"`OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED` are deprecated. "
332+
"You should install the opentelemetry-instrumentation-logging",
333+
DeprecationWarning,
331334
)
332335

333336
# Add OTel handler

opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,9 @@ def __init__(
496496
super().__init__(level=level)
497497
self._logger_provider = logger_provider or get_logger_provider()
498498

499-
warnings.deprecated(
500-
"This is deprecated you should use the one in opentelemetry-instrumentation-logging"
499+
warnings.warn(
500+
"This is deprecated you should use the one in opentelemetry-instrumentation-logging",
501+
DeprecationWarning,
501502
)
502503

503504
@staticmethod

0 commit comments

Comments
 (0)