From e90023281d2d5cbdf33c614e17791fdb7e3701d4 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sun, 28 Apr 2013 20:57:32 -0400 Subject: [PATCH] Slightly refine log output to include username in addition to pid. --- lib/ansible/callbacks.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ansible/callbacks.py b/lib/ansible/callbacks.py index dbd954f2b9..1b03d8ef97 100644 --- a/lib/ansible/callbacks.py +++ b/lib/ansible/callbacks.py @@ -25,13 +25,15 @@ import fnmatch import tempfile import fcntl import constants +import getpass 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 %(name)s %(message)s') - mypid = os.getpid() - logger = logging.getLogger(str(mypid)) + mypid = str(os.getpid()) + user = getpass.getuser() + logger = logging.getLogger("p=%s u=%s | " % (mypid, user)) callback_plugins = [x for x in utils.plugins.callback_loader.all()]