|
33 | 33 | import logging |
34 | 34 | import threading |
35 | 35 | import typing |
36 | | -import warnings |
37 | 36 | from types import TracebackType |
38 | 37 | from typing import ( |
39 | 38 | TYPE_CHECKING, |
@@ -378,47 +377,6 @@ def __init__( |
378 | 377 | def __str__(self) -> str: |
379 | 378 | return self.name |
380 | 379 |
|
381 | | - @classmethod |
382 | | - def current_context(cls) -> LoggingContextOrSentinel: |
383 | | - """Get the current logging context from thread local storage |
384 | | -
|
385 | | - This exists for backwards compatibility. ``current_context()`` should be |
386 | | - called directly. |
387 | | -
|
388 | | - Returns: |
389 | | - The current logging context |
390 | | - """ |
391 | | - warnings.warn( |
392 | | - "synapse.logging.context.LoggingContext.current_context() is deprecated " |
393 | | - "in favor of synapse.logging.context.current_context().", |
394 | | - DeprecationWarning, |
395 | | - stacklevel=2, |
396 | | - ) |
397 | | - return current_context() |
398 | | - |
399 | | - @classmethod |
400 | | - def set_current_context( |
401 | | - cls, context: LoggingContextOrSentinel |
402 | | - ) -> LoggingContextOrSentinel: |
403 | | - """Set the current logging context in thread local storage |
404 | | -
|
405 | | - This exists for backwards compatibility. ``set_current_context()`` should be |
406 | | - called directly. |
407 | | -
|
408 | | - Args: |
409 | | - context: The context to activate. |
410 | | -
|
411 | | - Returns: |
412 | | - The context that was previously active |
413 | | - """ |
414 | | - warnings.warn( |
415 | | - "synapse.logging.context.LoggingContext.set_current_context() is deprecated " |
416 | | - "in favor of synapse.logging.context.set_current_context().", |
417 | | - DeprecationWarning, |
418 | | - stacklevel=2, |
419 | | - ) |
420 | | - return set_current_context(context) |
421 | | - |
422 | 380 | def __enter__(self) -> "LoggingContext": |
423 | 381 | """Enters this logging context into thread local storage""" |
424 | 382 | logcontext_debug_logger.debug("LoggingContext(%s).__enter__", self.name) |
|
0 commit comments