Commit e35bd75a by Calen Pennington

Capitalize logger, since it's a constant

parent 850b696e
...@@ -10,7 +10,7 @@ import sys ...@@ -10,7 +10,7 @@ import sys
logging.basicConfig(level=logging.INFO, stream=sys.stdout) logging.basicConfig(level=logging.INFO, stream=sys.stdout)
logging.getLogger("requests").setLevel(logging.WARNING) logging.getLogger("requests").setLevel(logging.WARNING)
logging.getLogger("dd").setLevel(logging.WARNING) logging.getLogger("dd").setLevel(logging.WARNING)
logger = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
""" """
Originally written by 'Jharrod LaFon' Originally written by 'Jharrod LaFon'
...@@ -76,7 +76,7 @@ class DatadogFormatter(Formatter): ...@@ -76,7 +76,7 @@ class DatadogFormatter(Formatter):
tags=["playbook:{0}".format(self.clean_tag_value(playbook_name))] tags=["playbook:{0}".format(self.clean_tag_value(playbook_name))]
) )
except Exception as ex: except Exception as ex:
logger.error(ex.message) LOGGER.error(ex.message)
class JsonFormatter(Formatter): class JsonFormatter(Formatter):
...@@ -134,14 +134,14 @@ class LoggingFormatter(Formatter): ...@@ -134,14 +134,14 @@ class LoggingFormatter(Formatter):
) )
for name, timestamp in sorted_results[:10]: for name, timestamp in sorted_results[:10]:
logger.info( LOGGER.info(
"{0:-<80}{1:->8}".format( "{0:-<80}{1:->8}".format(
'{0} '.format(name), '{0} '.format(name),
' {0:.02f}s'.format(timestamp.duration.total_seconds()), ' {0:.02f}s'.format(timestamp.duration.total_seconds()),
) )
) )
logger.info("\nPlaybook {0} finished: {1}, {2} total tasks. {3} elapsed. \n".format( LOGGER.info("\nPlaybook {0} finished: {1}, {2} total tasks. {3} elapsed. \n".format(
playbook_name, playbook_name,
time.asctime(), time.asctime(),
len(results), len(results),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment