From 63cd16d03c7f1362018cd06a7373ecafcd3383c0 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 30 Jul 2014 19:46:53 -0700 Subject: Add support for printing the real thread ID with QT_MESSAGE_PATTERN %{threadid} should have been %{qthreadptr} but we forgot to make the change for Qt 5.4. So do it now. [ChangeLog][QtCore][Logging framework] %{threadid} now prints the real thread ID. On Linux, OS X, iOS, FreeBSD and Windows, the value is unique system-wide. On other systems, it will print something that may be process-specific (the value of pthread_self(3)). To print the pointer to QThread::current(), use %{qthreadptr}. Change-Id: Ie383ff864a11966cf5d095b966a30ace65d34ee6 Reviewed-by: Olivier Goffart --- tests/auto/corelib/global/qlogging/tst_qlogging.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/auto/corelib/global/qlogging/tst_qlogging.cpp') diff --git a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp index 140b349c64..c35a373d3f 100644 --- a/tests/auto/corelib/global/qlogging/tst_qlogging.cpp +++ b/tests/auto/corelib/global/qlogging/tst_qlogging.cpp @@ -765,9 +765,9 @@ void tst_qmessagehandler::qMessagePattern_data() << "A DEBUG qDebug " << "A qWarning "); - QTest::newRow("pid") << "%{pid}: %{message}" + QTest::newRow("pid-tid") << "%{pid}/%{threadid}: %{message}" << true << QList(); // can't match anything, just test validity - QTest::newRow("threadid") << "ThreadId:%{threadid}: %{message}" + QTest::newRow("qthreadptr") << "ThreadId:%{qthreadptr}: %{message}" << true << (QList() << "ThreadId:0x"); -- cgit v1.2.3