From c5063ebc198745386aca309291db4676da0f75f8 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 24 Jul 2007 18:29:18 -0400 Subject: [PATCH] Turn off logging by default; re-enable on a per-module basis using environment variables --- sugar/logger.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sugar/logger.py b/sugar/logger.py index 6d9ff3ab..c7f610e6 100644 --- a/sugar/logger.py +++ b/sugar/logger.py @@ -103,6 +103,11 @@ def _get_logs_dir(): return logs_dir def start(module_id): + # Only log if logging is set up for the activity + module_key = module_id.upper() + "_DEBUG" + if not os.environ.has_key(module_key): + return + log_writer = LogWriter(module_id) root_logger = logging.getLogger('')