logging: Clarify that QT_MESSAGE_PATTERN only applies to unstructured logging

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 <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Tor Arne Vestbø 2018-01-03 16:50:08 +01:00
parent b14934547a
commit 84e7b64090
1 changed files with 4 additions and 0 deletions

View File

@ -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}