summaryrefslogtreecommitdiff
path: root/daemons/lvmdbusd/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'daemons/lvmdbusd/utils.py')
-rw-r--r--daemons/lvmdbusd/utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/daemons/lvmdbusd/utils.py b/daemons/lvmdbusd/utils.py
index ec40236a5..3443bdad7 100644
--- a/daemons/lvmdbusd/utils.py
+++ b/daemons/lvmdbusd/utils.py
@@ -308,13 +308,17 @@ class DebugMessages(object):
def _format_log_entry(msg):
tid = ctypes.CDLL('libc.so.6').syscall(186)
- if STDOUT_TTY:
+ if not cfg.systemd and STDOUT_TTY:
msg = "%s: %d:%d - %s" % \
(datetime.datetime.now().strftime("%b %d %H:%M:%S.%f"),
os.getpid(), tid, msg)
else:
- msg = "%d:%d - %s" % (os.getpid(), tid, msg)
+ if cfg.systemd:
+ # Systemd already puts the daemon pid in the log, we'll just add the tid
+ msg = "[%d]: %s" % (tid, msg)
+ else:
+ msg = "[%d:%d]: %s" % (os.getpid(), tid, msg)
return msg