﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32552	Allow DiscoverRunner to use a logger instead of printing to stdout	Chris Jerdonek	Chris Jerdonek	"Currently, the `DiscoverRunner` class (used when running tests) ""logs"" by printing directly to stdout. Here is one example:
https://github.com/django/django/blob/7bdd09d016f418719f2d0297f58bd81c5349101d/django/test/runner.py#L592-L596

It would be much better if `DiscoverRunner` could instead use a Python logger. The ""verbosity"" of each `print()` statement could be converted to a log message at an appropriate level.

Related to this, passing a `--verbosity {0,1,2,3}` (e.g. when using [https://github.com/django/django/blob/7bdd09d016f418719f2d0297f58bd81c5349101d/tests/runtests.py#L433-L436 runtests.py]) could configure a logger at the appropriate level.

This ticket is related to (but different from) ticket #21429, which is about `BaseCommand`. While `DiscoverRunner` can be triggered by the `test` command, it can also be run separately from a management command, e.g. via `runtests`.
"	New feature	closed	Testing framework	4.0	Normal	fixed	DiscoverRunner,print,logging,stdout,stderr		Ready for checkin	1	0	0	0	0	0
