]> mj.ucw.cz Git - moe.git/commitdiff
Fixes around DEBUG_LEVEL
authorTomas Gavenciak <gavento@ucw.cz>
Sat, 18 Sep 2010 07:36:02 +0000 (09:36 +0200)
committerTomas Gavenciak <gavento@ucw.cz>
Sat, 18 Sep 2010 07:36:02 +0000 (09:36 +0200)
Introduce DEBUG_LEVEL dependency on VERBOSITY
TODO: solve DEBUG_LEVEL better (specially in eval.py?)

t/config
t/moe/eval.py

index 9390695a7a14168c6cd11904c8fbace544970c2d..b7ab48800a017e2b41845c60c72ff8801afb3e97 100644 (file)
--- 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"
index e8dbdce7ac16ac93f599e644fcec24b527e444fe..bcf0c5330dcb5b8771c6c993e327df74daaf8b34 100644 (file)
@@ -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)