Changed logger init and added verbose arg handling
Initialized logger with default value of NOTSET. Added if statement to handle verbose argument and set the logger to DEBUG. Change-Id: I997b8b964dade013db265d088d00ccfdd6ab030e Closes-Bug: #1269465
This commit is contained in:
parent
43c79ad94c
commit
7a604b2d5c
|
@ -29,8 +29,7 @@ from boto.ec2 import cloudwatch
|
|||
log_format = '%(levelname)s [%(asctime)s] %(message)s'
|
||||
log_file_name = "/var/log/cfn-push-stats.log"
|
||||
logging.basicConfig(filename=log_file_name,
|
||||
format=log_format,
|
||||
level=logging.DEBUG)
|
||||
format=log_format)
|
||||
LOG = logging.getLogger('cfntools')
|
||||
|
||||
try:
|
||||
|
@ -108,6 +107,11 @@ credentials = cfn_helper.parse_creds_file(args.credential_file)
|
|||
namespace = 'system/linux'
|
||||
data = {}
|
||||
|
||||
# Logging
|
||||
# =======
|
||||
if args.verbose:
|
||||
LOG.setLevel(logging.DEBUG)
|
||||
|
||||
# Generic user-specified metric
|
||||
# =============================
|
||||
if args.metric and args.units and args.value:
|
||||
|
|
Loading…
Reference in New Issue