@@ -441,13 +441,28 @@ def clear(self):
441
441
442
442
@_attr_setter
443
443
def level (self , value ):
444
- # type: (Optional[LogLevelStr]) -> None
445
- """When set this overrides the level. Deprecated in favor of set_level."""
444
+ # type: (LogLevelStr) -> None
445
+ """
446
+ When set this overrides the level.
447
+
448
+ .. deprecated:: 1.0.0
449
+ Use :func:`set_level` instead.
450
+
451
+ :param value: The level to set.
452
+ """
453
+ logger .warning (
454
+ "Deprecated: use .set_level() instead. This will be removed in the future."
455
+ )
456
+
446
457
self ._level = value
447
458
448
459
def set_level (self , value ):
449
- # type: (Optional[LogLevelStr]) -> None
450
- """Sets the level for the scope."""
460
+ # type: (LogLevelStr) -> None
461
+ """
462
+ Sets the level for the scope.
463
+
464
+ :param value: The level to set.
465
+ """
451
466
self ._level = value
452
467
453
468
@_attr_setter
@@ -555,20 +570,24 @@ def profile(self, profile):
555
570
556
571
self ._profile = profile
557
572
558
- def set_tag (
559
- self ,
560
- key , # type: str
561
- value , # type: Any
562
- ):
563
- # type: (...) -> None
564
- """Sets a tag for a key to a specific value."""
573
+ def set_tag (self , key , value ):
574
+ # type: (str, Any) -> None
575
+ """
576
+ Sets a tag for a key to a specific value.
577
+
578
+ :param key: Key of the tag to set.
579
+
580
+ :param value: Value of the tag to set.
581
+ """
565
582
self ._tags [key ] = value
566
583
567
- def remove_tag (
568
- self , key # type: str
569
- ):
570
- # type: (...) -> None
571
- """Removes a specific tag."""
584
+ def remove_tag (self , key ):
585
+ # type: (str) -> None
586
+ """
587
+ Removes a specific tag.
588
+
589
+ :param key: Key of the tag to remove.
590
+ """
572
591
self ._tags .pop (key , None )
573
592
574
593
def set_context (
@@ -577,7 +596,9 @@ def set_context(
577
596
value , # type: Dict[str, Any]
578
597
):
579
598
# type: (...) -> None
580
- """Binds a context at a certain key to a specific value."""
599
+ """
600
+ Binds a context at a certain key to a specific value.
601
+ """
581
602
self ._contexts [key ] = value
582
603
583
604
def remove_context (
0 commit comments