From a19af18747c99bf4aa22e9d17f9f85b27c354a37 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Fri, 8 Nov 2019 17:08:50 +0100 Subject: [PATCH] config: Better logging Shorter messages and to the point, also show when saved. --- weboob/tools/config/yamlconfig.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/weboob/tools/config/yamlconfig.py b/weboob/tools/config/yamlconfig.py index 55f8953b7f..58f2b498fa 100644 --- a/weboob/tools/config/yamlconfig.py +++ b/weboob/tools/config/yamlconfig.py @@ -66,14 +66,14 @@ def __init__(self, path): def load(self, default={}): self.values = default.copy() - LOGGER.debug(u'Loading application configuration file: %s.' % self.path) + LOGGER.debug(u'Loading configuration file: %s.' % self.path) try: with open(self.path, 'r') as f: self.values = yaml.load(f, Loader=self.LOADER) - LOGGER.debug(u'Application configuration file loaded: %s.' % self.path) + LOGGER.debug(u'Configuration file loaded: %s.' % self.path) except IOError: self.save() - LOGGER.debug(u'Application configuration file created with default values: %s. Please customize it.' % self.path) + LOGGER.debug(u'Configuration file created with default values: %s.' % self.path) if self.values is None: self.values = {} @@ -87,6 +87,7 @@ def save(self): with f: yaml.dump(self.values, f, Dumper=self.DUMPER, default_flow_style=False) replace(f.name, self.path) + LOGGER.debug(u'Configuration file saved: %s.' % self.path) def get(self, *args, **kwargs): v = self.values -- GitLab