From: Tomas Gavenciak Date: Sat, 18 Sep 2010 07:36:02 +0000 (+0200) Subject: Fixes around DEBUG_LEVEL X-Git-Tag: python-dummy-working~13 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=6f80b543eafc0e1c9644de1efb4db9ea97bab30d;p=moe.git Fixes around DEBUG_LEVEL Introduce DEBUG_LEVEL dependency on VERBOSITY TODO: solve DEBUG_LEVEL better (specially in eval.py?) --- diff --git a/t/config b/t/config index 9390695..b7ab488 100644 --- a/t/config +++ b/t/config @@ -1,5 +1,5 @@ # Basic directories -TDIR = "{HOME}/test" +TDIR = "{HOME}/testing" PDIR = "{HOME}/tasks/{TASK}" # Files @@ -7,6 +7,11 @@ USER_LOG = "{TDIR}/log" TASK_CONFIG = "{PDIR}/config" STATUS_FILE = "{TDIR}/status" +# Verbosity +DEBUG_LEVEL = "20" +if (VERBOSE=="1") {DEBUG_LEVEL="10"} +if (VERBOSE=="2") {DEBUG_LEVEL="0"} + # only for testing: TASK = "sum" TASK_TYPE = "dummy" diff --git a/t/moe/eval.py b/t/moe/eval.py index e8dbdce..bcf0c53 100644 --- a/t/moe/eval.py +++ b/t/moe/eval.py @@ -47,14 +47,10 @@ class Eval: # fix variables self.config.fix(['LOG', 'USER_LOG', 'VERBOSE', 'HOME', 'DEBUG_LEVEL', 'TDIR']) # start logging - self.log.open_eval_log(self['LOG'], self['DEBUG_LEVEL'], redirect_fds = True) + self.log.open_eval_log(self['LOG'], int(self['DEBUG_LEVEL']), redirect_fds = True) self.log.open_user_log(self['USER_LOG']) self.debug_dump_config() - # init and check TDIR - self.debug('Cleaning TDIR: %s'%self['TDIR']) - self.init_TDIR() - # insert hooks into main pipeline self.main_pipe.insert(5, "Eval.hook_init_dirs", self.hook_init_dirs) self.main_pipe.insert(15, "Eval.hook_load_task_config", self.hook_load_task_config)