-
Notifications
You must be signed in to change notification settings - Fork 550
Small APIdocs improvement #2828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
627282e
f1a6c13
2d051ad
0ad7db4
3b9c12b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -441,13 +441,28 @@ def clear(self): | |
|
||
@_attr_setter | ||
def level(self, value): | ||
# type: (Optional[LogLevelStr]) -> None | ||
"""When set this overrides the level. Deprecated in favor of set_level.""" | ||
# type: (LogLevelStr) -> None | ||
""" | ||
When set this overrides the level. | ||
|
||
.. deprecated:: 1.0.0 | ||
Use :func:`set_level` instead. | ||
|
||
:param value: The level to set. | ||
""" | ||
logger.warning( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @antonpirker Why are you emitting the warning with warnings.warn("blah blah blah", DeprecationWarning, stacklevel=2) Is there any significant difference with using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just used it because all the other deprecation warnings in that file do it the same way. |
||
"Deprecated: use .set_level() instead. This will be removed in the future." | ||
) | ||
|
||
self._level = value | ||
szokeasaurusrex marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
def set_level(self, value): | ||
# type: (Optional[LogLevelStr]) -> None | ||
"""Sets the level for the scope.""" | ||
# type: (LogLevelStr) -> None | ||
""" | ||
Sets the level for the scope. | ||
|
||
:param value: The level to set. | ||
""" | ||
self._level = value | ||
|
||
@_attr_setter | ||
|
@@ -555,20 +570,24 @@ def profile(self, profile): | |
|
||
self._profile = profile | ||
|
||
def set_tag( | ||
self, | ||
key, # type: str | ||
value, # type: Any | ||
): | ||
# type: (...) -> None | ||
"""Sets a tag for a key to a specific value.""" | ||
def set_tag(self, key, value): | ||
# type: (str, Any) -> None | ||
""" | ||
Sets a tag for a key to a specific value. | ||
|
||
:param key: Key of the tag to set. | ||
|
||
:param value: Value of the tag to set. | ||
""" | ||
self._tags[key] = value | ||
|
||
def remove_tag( | ||
self, key # type: str | ||
): | ||
# type: (...) -> None | ||
"""Removes a specific tag.""" | ||
def remove_tag(self, key): | ||
# type: (str) -> None | ||
""" | ||
Removes a specific tag. | ||
|
||
:param key: Key of the tag to remove. | ||
""" | ||
self._tags.pop(key, None) | ||
|
||
def set_context( | ||
|
@@ -577,7 +596,9 @@ def set_context( | |
value, # type: Dict[str, Any] | ||
): | ||
# type: (...) -> None | ||
"""Binds a context at a certain key to a specific value.""" | ||
""" | ||
Binds a context at a certain key to a specific value. | ||
""" | ||
self._contexts[key] = value | ||
|
||
def remove_context( | ||
|
Uh oh!
There was an error while loading. Please reload this page.