From 82fd626ded2282a38930ddeb8dbf26bffdae235e Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 13 Mar 2014 16:24:08 +0100 Subject: Document %{if-category} in default message pattern Commit 15ddb91b introduced %{if-category}, and changed the default message pattern. Adapt the documentation accordingly. Change-Id: I1d500122300c4d62171de3607553b3a5a822d4a7 Reviewed-by: Jerome Pasion --- src/corelib/global/qlogging.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index f67b87e2bc..8c1d8b867d 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1484,12 +1484,15 @@ void qErrnoWarning(int code, const char *msg, ...) \c %{if-warning}, \c %{if-critical} or \c %{if-fatal} followed by an \c %{endif}. What is inside the \c %{if-*} and \c %{endif} will only be printed if the type matches. + Finally, text inside \c %{if-category} ... \c %{endif} is only printed if the category + is not the default one. + Example: \code QT_MESSAGE_PATTERN="[%{if-debug}D%{endif}%{if-warning}W%{endif}%{if-critical}C%{endif}%{if-fatal}F%{endif}] %{file}:%{line} - %{message}" \endcode - The default \a pattern is "%{message}". + The default \a pattern is "%{if-category}%{category}: %{endif}%{message}". The \a pattern can also be changed at runtime by setting the QT_MESSAGE_PATTERN environment variable; if both qSetMessagePattern() is called and QT_MESSAGE_PATTERN is -- cgit v1.2.3