diff options
Diffstat (limited to 'gitautodeploy')
-rw-r--r-- | gitautodeploy/cli/config.py | 3 | ||||
-rw-r--r-- | gitautodeploy/gitautodeploy.py | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gitautodeploy/cli/config.py b/gitautodeploy/cli/config.py index 73fb96f..bdbe12f 100644 --- a/gitautodeploy/cli/config.py +++ b/gitautodeploy/cli/config.py @@ -15,6 +15,9 @@ def get_config_defaults(): config['port'] = 8001 config['intercept-stdout'] = True + # Record all log levels by default + config['log-level'] = 'NOTSET' + # Include details with deploy command return codes in HTTP response. Causes # to await any git pull or deploy command actions before it sends the # response. diff --git a/gitautodeploy/gitautodeploy.py b/gitautodeploy/gitautodeploy.py index 5341f52..cd90846 100644 --- a/gitautodeploy/gitautodeploy.py +++ b/gitautodeploy/gitautodeploy.py @@ -243,8 +243,10 @@ class GitAutoDeploy(object): consoleHandler.setFormatter(logFormatter) logger.addHandler(consoleHandler) - # All logs are recording - logger.setLevel(logging.NOTSET) + # Set logging level + if 'log-level' in self._config: + level = logging.getLevelName(self._config['log-level']) + logger.setLevel(level) if 'logfilepath' in self._config and self._config['logfilepath']: # Translate any ~ in the path into /home/<user> |