summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2024-02-03 07:37:21 (GMT)
committerGitHub <noreply@github.com>2024-02-03 07:37:21 (GMT)
commit28bb2961ba2f650452c949fcfc75ccfe0b5517e9 (patch)
tree40f2546da1b730ebd8611355abddf17119e512c9 /Doc
parent00d7109075dfaadf438362c084e8a1890c53d4c8 (diff)
downloadcpython-28bb2961ba2f650452c949fcfc75ccfe0b5517e9.zip
cpython-28bb2961ba2f650452c949fcfc75ccfe0b5517e9.tar.gz
cpython-28bb2961ba2f650452c949fcfc75ccfe0b5517e9.tar.bz2
Update LOGGING example taken from Django docs. (#114903)
For example, Django no longer provides a custom NullHandler https://github.com/django/django/commit/6c66a41c3dc697dc3bda4e31e8b05084d2ede915 * Remove require_debug_true.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/howto/logging-cookbook.rst25
1 files changed, 11 insertions, 14 deletions
diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst
index ea494f2..80147e3 100644
--- a/Doc/howto/logging-cookbook.rst
+++ b/Doc/howto/logging-cookbook.rst
@@ -1933,30 +1933,28 @@ This dictionary is passed to :func:`~config.dictConfig` to put the configuration
LOGGING = {
'version': 1,
- 'disable_existing_loggers': True,
+ 'disable_existing_loggers': False,
'formatters': {
'verbose': {
- 'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
+ 'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}',
+ 'style': '{',
},
'simple': {
- 'format': '%(levelname)s %(message)s'
+ 'format': '{levelname} {message}',
+ 'style': '{',
},
},
'filters': {
'special': {
'()': 'project.logging.SpecialFilter',
'foo': 'bar',
- }
+ },
},
'handlers': {
- 'null': {
- 'level':'DEBUG',
- 'class':'django.utils.log.NullHandler',
- },
- 'console':{
- 'level':'DEBUG',
- 'class':'logging.StreamHandler',
- 'formatter': 'simple'
+ 'console': {
+ 'level': 'INFO',
+ 'class': 'logging.StreamHandler',
+ 'formatter': 'simple',
},
'mail_admins': {
'level': 'ERROR',
@@ -1966,9 +1964,8 @@ This dictionary is passed to :func:`~config.dictConfig` to put the configuration
},
'loggers': {
'django': {
- 'handlers':['null'],
+ 'handlers': ['console'],
'propagate': True,
- 'level':'INFO',
},
'django.request': {
'handlers': ['mail_admins'],