summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin Funk <kevin.funk@kdab.com>2021-10-11 14:31:01 +0200
committerThiago Macieira <thiago.macieira@intel.com>2021-10-14 08:31:31 +0000
commitf08704330df1ffbaba5ee78215e5d65f4fb94e1e (patch)
tree1c318e54ca083bb1b9d86889c1d4ac18c919ba5f /src
parent146749f9b7bbfc0d495a8bd1edd4c6e602d5dcf5 (diff)
qtlogging: Document QT_MESSAGELOGCONTEXT define
Document it here to let people know about the pitfalls with some placeholder values. Link the QMessageLogContext class doc for more information. Pick-to: 6.2 Change-Id: I8e7b4c0dcb8bceeeee645664c98e63ae7ca7e854 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qlogging.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index cbb9e1963c..fd38a9d6c4 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -2021,13 +2021,17 @@ 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 information for the placeholders \c category, \c file, \c function and \c line is
+ only recorded in debug builds. Alternatively, \c QT_MESSAGELOGCONTEXT can be defined
+ explicitly. For more information refer to the QMessageLogContext documentation.
+
\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}
+ \sa qInstallMessageHandler(), {Debugging Techniques}, {QLoggingCategory}, QMessageLogContext
*/
QtMessageHandler qInstallMessageHandler(QtMessageHandler h)