Less logging in normal operations

This commit is contained in:
Stefan Reimer 2019-01-21 15:24:18 +00:00
parent 25c375728a
commit 3a4ec1924b
2 changed files with 11 additions and 5 deletions

View File

@ -76,7 +76,7 @@ class Stack(object):
if 'vars' in _config: if 'vars' in _config:
self.template_vars = dict_merge(self.template_vars, _config['vars']) self.template_vars = dict_merge(self.template_vars, _config['vars'])
logger.info("Stack {} added.".format(self.id)) logger.debug("Stack {} added.".format(self.id))
def check_fortytwo(self, template): def check_fortytwo(self, template):

View File

@ -53,15 +53,21 @@ def setup_logging(debug):
our_level = logging.DEBUG our_level = logging.DEBUG
# logging.getLogger("botocore").setLevel(logging.INFO) # logging.getLogger("botocore").setLevel(logging.INFO)
boto3.set_stream_logger('') boto3.set_stream_logger('')
formatter = logging.Formatter(
fmt="[%(asctime)s] %(name)s %(message)s",
datefmt="%Y-%m-%d %H:%M:%S"
)
else: else:
our_level = logging.INFO our_level = logging.INFO
logging.getLogger("botocore").setLevel(logging.CRITICAL) logging.getLogger("botocore").setLevel(logging.CRITICAL)
formatter = logging.Formatter( formatter = logging.Formatter(
fmt="[%(asctime)s] - %(name)s - %(message)s", fmt="[%(asctime)s] %(message)s",
datefmt="%Y-%m-%d %H:%M:%S" datefmt="%Y-%m-%d %H:%M:%S"
) )
log_handler = logging.StreamHandler() log_handler = logging.StreamHandler()
log_handler.setFormatter(formatter) log_handler.setFormatter(formatter)
logger = logging.getLogger("cloudbender") logger = logging.getLogger("cloudbender")