diff options
author | Aaron LI <aaronly.me@outlook.com> | 2016-10-14 23:27:09 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2016-10-14 23:27:13 +0800 |
commit | eb5fcaa13e0ba6391ed20fca5e3eb28a13fde7d1 (patch) | |
tree | ca162886ef95800ea494cef8c5fa791b902e83d5 /fg21sim/configs/manager.py | |
parent | a978bd5abcd02e8e0938098ee69ff475a02eebde (diff) | |
download | fg21sim-eb5fcaa13e0ba6391ed20fca5e3eb28a13fde7d1.tar.bz2 |
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.
Diffstat (limited to 'fg21sim/configs/manager.py')
-rw-r--r-- | fg21sim/configs/manager.py | 3 |
1 files changed, 3 insertions, 0 deletions
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) |