Slightly refine log output to include username in addition to pid.

This commit is contained in:
Michael DeHaan 2013-04-28 20:57:32 -04:00
parent ba8f2fca26
commit e90023281d

View file

@ -25,13 +25,15 @@ import fnmatch
import tempfile import tempfile
import fcntl import fcntl
import constants import constants
import getpass
from ansible.color import stringc 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 %(name)s %(message)s') logging.basicConfig(filename=constants.DEFAULT_LOG_PATH, level=logging.DEBUG, format='%(asctime)s %(name)s %(message)s')
mypid = os.getpid() mypid = str(os.getpid())
logger = logging.getLogger(str(mypid)) user = getpass.getuser()
logger = logging.getLogger("p=%s u=%s | " % (mypid, user))
callback_plugins = [x for x in utils.plugins.callback_loader.all()] callback_plugins = [x for x in utils.plugins.callback_loader.all()]