root: add process ID to logging output

This commit is contained in:
Jens Langhammer
2020-02-24 13:16:05 +01:00
parent 4daa70c894
commit 238b489e07
3 changed files with 17 additions and 0 deletions

9
passbook/lib/logging.py Normal file
View File

@ -0,0 +1,9 @@
"""logging helpers"""
from os import getpid
# pylint: disable=unused-argument
def add_process_id(logger, method_name, event_dict):
"""Add the current process ID"""
event_dict["pdi"] = getpid()
return event_dict