From eb5fcaa13e0ba6391ed20fca5e3eb28a13fde7d1 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 14 Oct 2016 23:27:09 +0800 Subject: configs: Support env variable "DEBUG_FG21SIM" for debugging Since the logging is not avaiable at the moment, we can only use the plain `print` for debugging, if the environment variable "DEBUG_FG21SIM" is defined. --- fg21sim/configs/manager.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fg21sim') diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py index fe3c18f..0250591 100644 --- a/fg21sim/configs/manager.py +++ b/fg21sim/configs/manager.py @@ -37,6 +37,9 @@ class ConfigManager: (optional) list of user config files to be merged """ configs_spec = sorted(glob(os.path.join(CONFIGS_PATH, "*.conf.spec"))) + if os.environ.get("DEBUG_FG21SIM"): + print("Found config specifications: %s" % ", ".join(configs_spec), + file=sys.stderr) spec = "\n".join([open(f).read() for f in configs_spec]).split("\n") self._configspec = ConfigObj(spec, interpolation=False, list_values=False, _inspec=True) -- cgit v1.2.2