From 3b8f69bac8feb8d3a9fc17c4a57ca0a1237014f4 Mon Sep 17 00:00:00 2001 From: Matt Coddington Date: Sat, 27 Apr 2013 13:00:02 -0400 Subject: [PATCH] add pid to log --- lib/ansible/callbacks.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ansible/callbacks.py b/lib/ansible/callbacks.py index 33785dfe62..dbd954f2b9 100644 --- a/lib/ansible/callbacks.py +++ b/lib/ansible/callbacks.py @@ -29,7 +29,9 @@ from ansible.color import stringc import logging 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()] @@ -106,9 +108,9 @@ def display(msg, color=None, stderr=False, screen_only=False, log_only=False): msg = msg.replace("\n","") if not screen_only: if color == 'red': - logging.error(msg) + logger.error(msg) else: - logging.info(msg) + logger.info(msg) log_unflock() def call_callback_module(method_name, *args, **kwargs):