From 5ca9ab796d56d8005b5b3fa9c4b147c5dd5a5eaf Mon Sep 17 00:00:00 2001 From: Tobias Witek Date: Fri, 14 Jul 2017 17:11:20 +0200 Subject: [PATCH] [engine] Add logging for configuration file For troubleshooting. see #138 --- README.md | 2 +- bumblebee/engine.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ed5f53..3307bbd 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ $ ./bumblebee-status -l themes $ ./bumblebee-status -l modules ``` -Any parameter you can specify with `-p =`, you can alternatively specify in `~/.bumblebee-status.conf` or `~/.config/bumblebee-status.conf`. +Any parameter you can specify with `-p =`, you can alternatively specify in `~/.bumblebee-status.conf` or `~/.config/bumblebee-status.conf`. This parameters act as a **fallback**, so value specified with `-p` have priority. Configuration files have a format like this: ``` diff --git a/bumblebee/engine.py b/bumblebee/engine.py index a4e63b8..e08b639 100644 --- a/bumblebee/engine.py +++ b/bumblebee/engine.py @@ -43,6 +43,7 @@ class Module(object): if os.path.exists(cfg): self._configFile = RawConfigParser() self._configFile.read(cfg) + log.debug("reading configuration file {}".format(cfg)) break if self._configFile is not None and self._configFile.has_section("module-parameters"): @@ -77,9 +78,12 @@ class Module(object): """Return the config parameter 'name' for this module""" name = "{}.{}".format(self.name, name) value = self._config["config"].get(name, default) + log.debug("command line parameter {}={}".format(name, str(value))) if value == default: try: + log.debug("trying to read {} from configuration file".format(name)) value = self._configFile.get("module-parameters", name) + log.debug("configuration file {}={}".format(name, str(value))) except: pass return value