From 15c069d4110d5857cf2162e74ade9592220e26c3 Mon Sep 17 00:00:00 2001 From: Peter Desmet Date: Thu, 15 Mar 2018 16:12:47 +0100 Subject: [PATCH] Import logging in LOG_FILTER examples --- docs/settings.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index a1a17e47..7c8da63c 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -1161,15 +1161,17 @@ Simply populate the list with the log messages you want to hide, and they will be filtered out. For example:: - - [(logging.WARN, 'TAG_SAVE_AS is set to False')] + + import logging + LOG_FILTER = [(logging.WARN, 'TAG_SAVE_AS is set to False')] It is possible to filter out messages by a template. Check out source code to obtain a template. For example:: - [(logging.WARN, 'Empty alt attribute for image %s in %s')] + import logging + LOG_FILTER = [(logging.WARN, 'Empty alt attribute for image %s in %s')] .. Warning:: Silencing messages by templates is a dangerous feature. It is possible to