question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sanic enables writing of DeprecationWarning to the log

See original GitHub issue

Describe the bug Sanic changes the default DeprecationWarning behaviour to be written to the log. The code line that cause it is in app.py line 104: filterwarnings("once", category=DeprecationWarning)

This change makes all of the DeprecationWarning, in every 3rd party library we use, to be written to the log.

Expected behavior I would expect that this will not happen in production 😅

Environment (please complete the following information):

  • OS: ubuntu & macOS
  • Sanic Version: 22.6

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
azimovMichaelcommented, Aug 30, 2022

Yeah, I guess an ENABLE_DEPRECATION_WARNINGS config var would be best. I can submit a PR if you like

1reaction
ahopkinscommented, Sep 14, 2022

Unfortunately I probably wont be able to get to this before the next release בתאריך יום ד׳, 14 בספט׳ 2022 ב-14:31 מאת Adam Hopkins < @.***>:

No worries. I will add it. יום טוב

Read more comments on GitHub >

github_iconTop Results From Across the Web

Logging — Sanic 20.12.3 documentation - Read the Docs
Logging ¶. Sanic allows you to do different types of logging (access log, error log) on the requests based on the python3 logging...
Read more >
sanic-cors/CHANGELOG.md at master - GitHub
A Sanic extension for handling Cross Origin Resource Sharing (CORS), making cross-origin AJAX possible. Based on flask-cors by Cory Dolphin.
Read more >
Logging | Sanic Framework
Sanic allows you to do different types of logging (access log, error log) on the requests based on the Python logging API (opens...
Read more >
warnings — Warning control — Python 3.11.1 documentation
Warning messages are normally written to sys.stderr , but their ... logging.captureWarnings() allows you to handle all warnings with the standard logging ......
Read more >
How to enable testing for DeprecationWarning and ...
If you start with a minimal test_one.py def test_one(): from collections import Hashable. a simple setup.py : from setuptools import setup, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found