From 8b3aaac72d337940b2af1548314c4e252db6881f Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sun, 27 May 2018 09:48:23 +0200 Subject: [PATCH] Improve debug messages for AMP --- glances/amps/glances_amp.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/glances/amps/glances_amp.py b/glances/amps/glances_amp.py index fad142b5..6eeb4740 100644 --- a/glances/amps/glances_amp.py +++ b/glances/amps/glances_amp.py @@ -48,7 +48,7 @@ class GlancesAmp(object): def __init__(self, name=None, args=None): """Init AMP classe.""" - logger.debug("Init {} version {}".format(self.NAME, self.VERSION)) + logger.debug("AMP - Init {} version {}".format(self.NAME, self.VERSION)) # AMP name (= module name without glances_) if name is None: @@ -86,7 +86,7 @@ class GlancesAmp(object): amp_section = 'amp_' + self.amp_name if (hasattr(config, 'has_section') and config.has_section(amp_section)): - logger.debug("{}: Load configuration".format(self.NAME)) + logger.debug("AMP - {}: Load configuration".format(self.NAME)) for param, _ in config.items(amp_section): try: self.configs[param] = config.get_float_value(amp_section, param) @@ -94,9 +94,9 @@ class GlancesAmp(object): self.configs[param] = config.get_value(amp_section, param).split(',') if len(self.configs[param]) == 1: self.configs[param] = self.configs[param][0] - logger.debug("{}: Load parameter: {} = {}".format(self.NAME, param, self.configs[param])) + logger.debug("AMP - {}: Load parameter: {} = {}".format(self.NAME, param, self.configs[param])) else: - logger.debug("{}: Can not find section {} in the configuration file".format(self.NAME, self.amp_name)) + logger.debug("AMP - {}: Can not find section {} in the configuration file".format(self.NAME, self.amp_name)) return False # enable, regex and refresh are mandatories @@ -104,10 +104,10 @@ class GlancesAmp(object): if self.enable(): for k in ['regex', 'refresh']: if k not in self.configs: - logger.warning("{}: Can not find configuration key {} in section {}".format(self.NAME, k, self.amp_name)) + logger.warning("AMP - {}: Can not find configuration key {} in section {}".format(self.NAME, k, self.amp_name)) self.configs['enable'] = 'false' else: - logger.debug("{} is disabled".format(self.NAME)) + logger.debug("AMP - {} is disabled".format(self.NAME)) # Init the count to 0 self.configs['count'] = 0