# Logging.warning vs. warnings.warn

**URL:** <https://discuss.python.org/t/logging-warning-vs-warnings-warn/12625>\
**Category:** Core Development\
**Created:** [December 18, 2021, 1:41am UTC](https://discuss.python.org/t/logging-warning-vs-warnings-warn/12625 "2021-12-18T01:41:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![vsajip](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/vsajip/32/44_2.png) [@vsajip](https://discuss.python.org/u/vsajip)\
**Post date:** [December 18, 2021, 2:57pm UTC](https://discuss.python.org/t/logging-warning-vs-warnings-warn/12625/2 "2021-12-18T14:57:16Z")

</div>

In those two examples you give, it may be that a developer can change the situation (comment length, environment variables) so it’s not clear-cutas to which of `logging.warning()` or `warnings.warn()` is more appropriate. Also, as Raymond said in the issue, there’s no need to change anything if the _status quo_ isn’t leading to a specific problem. The “How to use logging” docs are advisory and are not specifically aimed at core developers (the stdlib could be considered a special case for certain things).

---

_[View the full topic](https://discuss.python.org/t/logging-warning-vs-warnings-warn/12625)._
