Skip to content
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

Double-printing text in django runserver_plus #1492

Closed
ajmath62 opened this issue Mar 27, 2019 · 2 comments
Closed

Double-printing text in django runserver_plus #1492

ajmath62 opened this issue Mar 27, 2019 · 2 comments
Assignees
Milestone

Comments

@ajmath62
Copy link

On a Django project using django_extensions, using python manage.py runserver_plus with the latest werkzeug (v0.15.1) results in double-printing all logging statements. This is not an issue in v0.14.1; the issue arose in commit 4cf77d2. The reason for this issue is that runserver_plus modifies the werkzeug logger by setting its log level and adding a handler. Older versions of werkzeug only added a log handler if there was no log level and no handler on the root logger. Since that commit, werkzeug adds a log handler if there is no handler on the root logger, regardless of log level. This results in there being two handlers, and thus all logging statements get printed twice. If werkzeug checks for a handler on the werkzeug logger instead of the root logger, the second handler won't get added. Is there a reason to check the root logger for handlers, seeing as werkzeug doesn't use the root logger?

@davidism
Copy link
Member

See #1407 cc @ramnes

@davidism davidism self-assigned this Apr 2, 2019
@davidism davidism added this to the 0.15.2 milestone Apr 2, 2019
@davidism
Copy link
Member

davidism commented Apr 2, 2019

Needs the same level check as pallets/flask#2436.

@davidism davidism closed this as completed Apr 2, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants