comparison util/Logger.py @ 83:0bc486356e2a draft

planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit ac73da32d59853ca563e7939d05016a6f3a6899e-dirty
author yating-l
date Mon, 30 Oct 2017 12:01:23 -0400
parents 4ca7cbf2d9b8
children
comparison
equal deleted inserted replaced
82:62600ac1d0f7 83:0bc486356e2a
22 if self.debug.lower() == "true": 22 if self.debug.lower() == "true":
23 default_level=logging.DEBUG 23 default_level=logging.DEBUG
24 if os.path.exists(config_path): 24 if os.path.exists(config_path):
25 with open(config_path, 'rt') as f: 25 with open(config_path, 'rt') as f:
26 config = json.load(f) 26 config = json.load(f)
27 config["root"]["level"] = default_level 27 config["handlers"]["console"]["level"] = default_level
28 if self.extra_files_path: 28 if self.extra_files_path:
29 for i in config["handlers"]: 29 for i in config["handlers"]:
30 if "filename" in config["handlers"][i]: 30 if "filename" in config["handlers"][i]:
31 config["handlers"][i]["filename"] = os.path.join(self.extra_files_path, config["handlers"][i]["filename"]) 31 config["handlers"][i]["filename"] = os.path.join(self.extra_files_path, config["handlers"][i]["filename"])
32 logging.config.dictConfig(config) 32 logging.config.dictConfig(config)