summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qlogging.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-3/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Logging: Mark deprecated API with QT_DEPRECATEDKai Koehne2012-10-161-2/+3
| | | | | | | | | | Still use it in qtestlib though because using qInstallMessageHandler here would break all tests (still) using qInstallMsgHandler - Qt always uses the new message handler if there's one, ignoring any message handler installed through deprecated API. Change-Id: I6fefefb315a2421425d2b7787e367fd348a33d83 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QMessageLogger: mark noDebug() as nothrowMarc Mutz2012-08-181-1/+1
| | | | | Change-Id: Ib01ad955844e8da376c687876141ad8f21776613 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMessageLogger: make member functions constMarc Mutz2012-08-181-9/+9
| | | | | | | | | | Just because we can :) It looks a bit weird that QMessageLogger has a constexpr constructor, but no const methods... Change-Id: I794dd2b3326c45be17b29decb47c9cac4778d397 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Logging: mark qt_assert()/qt_assert_x()/qFatal() as nothrowMarc Mutz2012-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | These functions are not supposed to return, not even by exception. qt_message() _can_ throw, but we're fine with the compiler calling std::terminate() then, since the backtrace will still include the assertion location. This behaviour is ensured by a new macro, QT_TERMINATE_ON_EXCEPTION, which expands to something like try { expr; } catch(...) { std::terminate(); } if the compiler doesn't support Q_DECL_NOEXCEPT (but maybe Q_DECL_NOTHROW), and to something like just expr; otherwise (including in the QT_NO_EXCEPTION case). The real macro preserves scopes in all cases, and aims to work even if <exception> isn't included in the TU it's used in, so is a little bit more complex than that. Change-Id: Ie6a2b7776e6aa77e57bd9aea6e184e5fa1cec81c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMessageLogger: mark default ctor as constexpr, tooMarc Mutz2012-08-071-2/+2
| | | | | | Change-Id: I6f92f4a01e43dbe811b11b3e8d9b8a02a31463c5 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix order of QT_END_NAMESPACE and QT_END_HEADER macrosSergio Ahumada2012-08-031-1/+1
| | | | | Change-Id: I798311bdacaac341210626489410740c130f8724 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Logging: Remove outdated QMessageHandlerKai Koehne2012-06-101-4/+0
| | | | | | | | Commit d9a1c2dff replaced QMessageHandler with QtMessageHandler. However, the old signature was still supported for a grace period. Change-Id: I3141499efdc749460b77de1ceec82f312e904bec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-05-031-1/+8
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qlogging.cpp src/gui/kernel/qguiapplication.h src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow.h tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp Change-Id: I62a8805577a7940d4d36bed985eb3e7019d22f2e
| * Allow qDebug output to be configured by qSetMessagePattern()Kai Koehne2012-04-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add qSetMessagePattern() to configure the default message pattern. This one can still be overwritten by setting the QT_MESSAGE_PATTERN environment variable. Without this method, there's actually no way to change the default output programatically. Since QT_MESSAGE_PATTERN is evaluated when the first message arrives, setting it via e.g. qputenv might have no effect/be too late. Change-Id: I115e0c30606f128fdbf5c169a951ffa2a6a48517 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Logging: Change arguments of message handler to avoid conversionsKai Koehne2012-04-201-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new QtMessageHandler that takes QString instead of char *: This avoids converting to local8bit , only to convert it back to utf16 for Windows. The old QMessageHandler is kept for a transition period, but will be removed before Qt 5.0. Also fix qEmergencyOut (that is called in OOM situations) to not rely on the default message handler. Change-Id: Iee0ce5838f97175c98788b847964273dd22d4a37 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Mark qt_assert and qFatal as non-returning functions (excpt. MSVC)Thiago Macieira2012-04-191-0/+4
|/ | | | | | | | | | | | | | | | | | | This allows the compiler to optimise the code a bit better: since they don't return, it can assume in the code after the Q_ASSERT that the condition was true. MSVC is the exception: with MSVC, we have the CrtDbgReport dialog, which allows the developer to continue execution, inside the debugger. Therefore, we can't mark any of those functions as non-returning because they can, after all, return. Unfortunately, the Q_ASSERT usually expands to no code in release mode, so the improvement in code generation happens in debug mode only... Change-Id: I4d542d6853cd51c71ffab1d563ed64ef7c419115 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Prepare category logging for Qt integrationWolfgang Beck2012-04-031-5/+9
| | | | | | | Change-Id: I0c784a945fe87d7ba52a44f5c7246de1709ae888 Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com> Reviewed-by: Peter Yard <peter.yard@nokia.com> Reviewed-by: Alex <alex.blasche@nokia.com>
* Reshuffle code between qglobal, qloggingKai Koehne2012-02-131-5/+9
| | | | | | | Make the content of the .h, .cpp files match. Change-Id: Ib2506aeff74281ec4bcbf04d21da451038391203 Reviewed-by: David Faure <faure@kde.org>
* Fix compilation with -Werror -WshadowDavid Faure2012-02-081-2/+2
| | | | | Change-Id: I2ef8f288415820fa08e5bab8b99a00b1ad0f2988 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtDebug: Include file, line, function informationKai Koehne2012-02-011-0/+161
Record the file, line, and function where a qDebug, qWarning, qCritical or qFatal call happens, and make this information available in a custom message handler. The patch uses the C preprocessor to replace qDebug, qWarning, ... with a line that also records the current file, line, and function. Custom message handlers can access this information via a new QMessageLogContext argument. Change-Id: I0a9b89c1d137e41775932d3b1a35da4ebf12d18d Reviewed-by: David Faure <faure@kde.org>