Commit ba8f2fca by Michael DeHaan

Merge branch 'add_pid_to_logging' of git://github.com/mcodd/ansible into devel

parents df3c4849 3b8f69ba
...@@ -29,7 +29,9 @@ from ansible.color import stringc ...@@ -29,7 +29,9 @@ from ansible.color import stringc
import logging import logging
if constants.DEFAULT_LOG_PATH != '': if constants.DEFAULT_LOG_PATH != '':
logging.basicConfig(filename=constants.DEFAULT_LOG_PATH, level=logging.DEBUG, format='%(asctime)s %(message)s') logging.basicConfig(filename=constants.DEFAULT_LOG_PATH, level=logging.DEBUG, format='%(asctime)s %(name)s %(message)s')
mypid = os.getpid()
logger = logging.getLogger(str(mypid))
callback_plugins = [x for x in utils.plugins.callback_loader.all()] callback_plugins = [x for x in utils.plugins.callback_loader.all()]
...@@ -106,9 +108,9 @@ def display(msg, color=None, stderr=False, screen_only=False, log_only=False): ...@@ -106,9 +108,9 @@ def display(msg, color=None, stderr=False, screen_only=False, log_only=False):
msg = msg.replace("\n","") msg = msg.replace("\n","")
if not screen_only: if not screen_only:
if color == 'red': if color == 'red':
logging.error(msg) logger.error(msg)
else: else:
logging.info(msg) logger.info(msg)
log_unflock() log_unflock()
def call_callback_module(method_name, *args, **kwargs): def call_callback_module(method_name, *args, **kwargs):
......
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