From 84e7b6409042b269c89dff2187f563027e379ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 3 Jan 2018 16:50:08 +0100 Subject: logging: Clarify that QT_MESSAGE_PATTERN only applies to unstructured logging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Structured sinks such as systemd should capture each piece of information individually, not bake it into the message via the message pattern. Change-Id: I164c043683f123764a5445dc9faad049e25fd738 Reviewed-by: Simon Hausmann Reviewed-by: Tor Arne Vestbø --- src/corelib/global/qlogging.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 0861763492..2bacdbb77c 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1886,6 +1886,10 @@ void qErrnoWarning(int code, const char *msg, ...) environment variable; if both \l qSetMessagePattern() is called and QT_MESSAGE_PATTERN is set, the environment variable takes precedence. + \note The message pattern only applies to unstructured logging, such as the default + \c stderr output. Structured logging such as systemd will record the message as is, + along with as much structured information as can be captured. + Custom message handlers can use qFormatLogMessage() to take \a pattern into account. \sa qInstallMessageHandler(), {Debugging Techniques}, {QLoggingCategory} -- cgit v1.2.3