summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/releases/1.4.txt3
-rw-r--r--docs/topics/logging.txt13
2 files changed, 10 insertions, 6 deletions
diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt
index 90c5e24e9d..f12db2817b 100644
--- a/docs/releases/1.4.txt
+++ b/docs/releases/1.4.txt
@@ -593,8 +593,7 @@ to :class:`django.utils.log.AdminEmailHandler` to prevent admin error emails in
'filters': {
'require_debug_false': {
- '()': 'django.utils.log.CallbackFilter',
- 'callback': lambda r: not DEBUG
+ '()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
diff --git a/docs/topics/logging.txt b/docs/topics/logging.txt
index f23b529d97..0175e8576f 100644
--- a/docs/topics/logging.txt
+++ b/docs/topics/logging.txt
@@ -504,8 +504,8 @@ Python logging module.
Filters
-------
-Django provides one log filter in addition to those provided by the
-Python logging module.
+Django provides two log filters in addition to those provided by the Python
+logging module.
.. class:: CallbackFilter(callback)
@@ -516,14 +516,19 @@ Python logging module.
through the filter. Handling of that record will not proceed if the callback
returns False.
+.. class:: RequireDebugFalse()
+
+ .. versionadded:: 1.4
+
+ This filter will only pass on records when settings.DEBUG is False.
+
This filter is used as follows in the default :setting:`LOGGING`
configuration to ensure that the :class:`AdminEmailHandler` only sends error
emails to admins when :setting:`DEBUG` is `False`::
'filters': {
'require_debug_false': {
- '()': 'django.utils.log.CallbackFilter',
- 'callback': lambda r: not DEBUG
+ '()': 'django.utils.log.RequireDebugFalse',
}
},
'handlers': {