summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwm2016 <TM2086@att.com>2016-02-24 13:22:43 -0600
committertwm2016 <TM2086@att.com>2016-03-01 11:27:59 -0600
commit7a604b2d5cb3468bedcdc91c858a8a29c5bbcd05 (patch)
tree0746d2925f3f8b4e0c59310225b7862961d0a21b
parent43c79ad94ca9c564c406b772819fa3adf145c0dd (diff)
downloadheat-cfntools-7a604b2d5cb3468bedcdc91c858a8a29c5bbcd05.tar.gz
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
-rwxr-xr-xbin/cfn-push-stats8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/cfn-push-stats b/bin/cfn-push-stats
index da0d155..501a366 100755
--- a/bin/cfn-push-stats
+++ b/bin/cfn-push-stats
@@ -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: