Opened 9 years ago
Closed 8 years ago
#27931 closed Cleanup/optimization (fixed)
Clarify the meaning of "django catch-all logger"
| Reported by: | Jesse | Owned by: | |
|---|---|---|---|
| Component: | Documentation | Version: | 1.10 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
Django docs state that, when DEBUG = True, all log messages INFO or higher should go to the console. However, it appears that the level is actually WARN or higher:
import logging logger = logging.getLogger(__name__) logger.info("info") logger.warning("warning") logger.error("error") logger.critical("critical")
And the output in the console:
warning error critical
Change History (7)
comment:1 by , 9 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 9 years ago
comment:3 by , 9 years ago
| Summary: | Minimum console logging level for DEBUG=True is too high → Clarify the meaning of "django catch-all logger" |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
| Type: | Bug → Cleanup/optimization |
This looks like a misunderstanding of how logging works. "The django catch-all logger" only processes messages in the "django" namespace. For example, this will log the message:
import logging
logger = logging.getLogger('django')
logger.info("info")
It's not the Django's documentation to do a comprehensive explanation of Python logging, but some improvement might be possible.
comment:6 by , 9 years ago
| Patch needs improvement: | set |
|---|
Is it considered a documentation error/typo, or is documentation correct here and the code should be updated to reflect it?