With the change to Django 1.3, DEBUG=True in settings.ini will make the queries performed by the ORM subsystem to be printed, hence the scheduler logs will contain those queries.
As this is too much verbosity for 'production' autotest servers, turned DEBUG and DEBUG_TEMPLATE django config variables into configurable options on global_config.ini. The options were explained, and DEBUG is set to False by default. Signed-off-by: Lucas Meneghel Rodrigues <[email protected]> --- frontend/settings.py | 10 ++++++---- global_config.ini | 10 ++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/frontend/settings.py b/frontend/settings.py index 8497cf2..6bd5f6f 100644 --- a/frontend/settings.py +++ b/frontend/settings.py @@ -4,8 +4,12 @@ import os import common from autotest_lib.client.common_lib import global_config -DEBUG = True -TEMPLATE_DEBUG = DEBUG +c = global_config.global_config +_section = 'AUTOTEST_WEB' + +DEBUG = c.get_config_value(_section, "sql_debug_mode", type=bool, default=False) +TEMPLATE_DEBUG = c.get_config_value(_section, "template_debug_mode", type=bool, + default=False) FULL_ADMIN = False @@ -21,8 +25,6 @@ DATABASE_ENGINE = 'autotest_lib.frontend.db.backends.afe' DATABASE_PORT = '' # Set to empty string for default. # Not used with sqlite3. -c = global_config.global_config -_section = 'AUTOTEST_WEB' DATABASE_HOST = c.get_config_value(_section, "host") # Or path to database file if using sqlite3. DATABASE_NAME = c.get_config_value(_section, "database") diff --git a/global_config.ini b/global_config.ini index 2aee078..610bcfd 100644 --- a/global_config.ini +++ b/global_config.ini @@ -17,6 +17,16 @@ min_retry_delay: 20 max_retry_delay: 60 graph_cache_creation_timeout_minutes: 10 parameterized_jobs: False +# Whether to enable django template debug mode. If this is set to True, all +# django errors will be wrapped in a nice debug page with detailed environment +# and stack trace info. Turned off by default. +template_debug_mode: False +# Whether to enable django SQL debug mode. If this is set to True, all +# queries performed by the Object Relational Mapper subsystem will be printed, +# which means the scheduler logs will contains all the queries executed. This +# is too much verbosity for 'production' systems, hence turned off by default. +sql_debug_mode: False + [TKO] host: localhost -- 1.7.5.4 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
