summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qlogging.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix memory leak in qSetMessagePatternKai Koehne2015-02-021-2/+6
| | | | | | | | | We were leaking memory in case setPattern was called multiple times Task-number: QTBUG-43893 Change-Id: Icd9c214edea064aeaeb6f92a9c62836238ccd344 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Simplify use of __has_include in qlogging.cppThiago Macieira2014-12-201-12/+9
| | | | | | | Easier to just #define it to 0 Change-Id: Ife99fdca6564077762fa67c6d7a5becaf48655d8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix constant "Qt" LOG_TAG in AndroidAndré Klitzing2014-12-151-2/+2
| | | | | | | | | | | | The LOG_TAG for Android can be set by QCoreApplication::applicationName instead of a constant "Qt" tag. This will avoid that multiple apps will use the same tag. Also it will be easier to filter the logs for different apps instead of "adb logcat -s Qt" for all Qt apps. Change-Id: I422cc3adf8b526634b5daa9a1bb1b90403de5618 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix the %{time} printing to *not* default to the process's timeThiago Macieira2014-11-211-7/+11
| | | | | | | | | | | The default should be the actual time of day. Showing the process's time is the optional case. In the future, we'll provide a way to showing the monotonic reference time ("boot") and we should improve the detection of actual application runtime. Change-Id: I41936d77ab9fad2073dc0ce1c97cabe57ec39f16 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Oswald Buddenhagen2014-10-281-1/+1
|\ | | | | | | Change-Id: I224e44a9df314b9a99d33148b6cf400fcbc9de8e
| * Add missing newline in fallback debug output.Volker Krause2014-10-281-1/+1
| | | | | | | | | | | | | | | | | | This is hit in case of a recursion in the message handler, and message hasn't gone through qMessageFormatString at this point and thus lacks the newline. Change-Id: Ia098b6ccbcc1aff22a4695865f39143ba0152d9c Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Doc: Corrected autolink errors qtbaseNico Vertriest2014-10-271-1/+1
| | | | | | | | | | | | Task-number: QTBUG-40362 Change-Id: I054a4713bdd83280be51697689e0c3c3409b9601 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* | Remove trailing '\n' in qFormatLogMessage outputKai Koehne2014-10-271-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not automatically add a \n to all messages formatted by qFormatLogMessage. Some backends require a final newline, some don't, so it's best to only append it where it's actually needed. The returned string will be null if the pattern is empty. This allows to differentiate between the case that the pattern just didn't apply (empty line is printed), and the case that qSetMessagePattern(QString()) have been called (nothing is printed). Change-Id: I17fde997a4074f58f82de6dea129948155c322d6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | logging: Fix qCleanupFuncinfo to not mangle Objective-C message namesTor Arne Vestbø2014-10-201-2/+3
| | | | | | | | | | | | Change-Id: I823566ba72668c611d225aa92c4d09a53cabe8fc Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Logging: Disable tracking of debug source info for release buildsKai Koehne2014-10-011-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tracking the file, line, function means the information has to be stored in the binaries, enlarging the size. It also might be a surprise to some commercial customers that their internal file & function names are 'leaked'. Therefore we enable it for debug builds only. [ChangeLog][QtCore][Logging] File, line, function information are not recorded anymore for logging statements in release builds. Set QT_MESSAGELOGCONTEXT explicitly to enable recording in all configurations. Change-Id: I454bdb42bcf5b5a8de6507f29f2a61109dca9b91 Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Update the detection of when to log to stderrThiago Macieira2014-09-291-47/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, the detection changes only by inserting the use of the environment variable before the existing tests and removing the check on stderr. This commit adds logic similar to Windows's: if the application has a controlling TTY, we'll use stderr. Otherwise, we'll use the system log. This is technically a change in behavior: previously, we would always use the system log, unless the environment variable told us not to. In practice, the behavior doesn't really change: Android and BlackBerry and systemd-spawned applications are launched with no controlling TTY, so logging will go to their logging systems. [ChangeLog][Important behavior changes][Logging (including qDebug and qWarning)] Log output will now go to the system log (if support for it was compiled into Qt) if the application has no controlling terminal or console window. Set QT_LOGGING_TO_CONSOLE to 1 to force logging to go to stderr. Task-number: QTCREATORBUG-12564 Change-Id: I043c5c4f47c15f26d4f4a5cf43df466ea38cdbc7 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Frederik Gladhorn2014-09-241-6/+3
|\ \
| * | Merge remote-tracking branch 'origin/5.3' into 5.4Frederik Gladhorn2014-09-231-6/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
| | * Logging: Remove use of _declspec(thread)Kai Koehne2014-09-151-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | thread-local variables are known to be broken on Windows XP if the library is loaded dynamically. This has been fixed since Windows Vista, but to avoid any elaborate runtime checking of the OS version we're just removing the logic alltogether for MSVC / Windows. Task-number: QTBUG-41008 Change-Id: I64ee95270d142294c975a5890d6e1b62a833b6ef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Unify the environment variables used for console loggingThiago Macieira2014-09-231-24/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Important behavior changes][Logging (including qDebug and qWarning)] Support for the deprecated environment variables QT_NO_JOURNALD_LOG and QT_ANDROID_PLAIN_LOG has been removed. Instead, set QT_LOGGING_TO_CONSOLE to 1 to force logging to the console (stderr). Set that variable to 0 to force logging to the system-specific event log (if any). Change-Id: I4800fc061752421f67aba1bf4535d524607579d5 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Logging: use the known function when the first frame of the backtrace is unknownOlivier Goffart2014-08-051-3/+7
| | | | | | | | | | | | Change-Id: Ia591805c82e7bf77dc7af04f1054c7daca58eb6a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Add qFormatLogMessage()Kai Koehne2014-07-301-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Export the former qMessageFormatString() as qFormatLogMessage(). This allows custom message handlers to format their messages just like the default message handler, taking qSetMessagePattern() / QT_MESSAGE_PATTERN into account. The method should arguably not add the '\n' at the end, which a follow up commit will fix. Change-Id: Ib2a9cfda91473df079daf03bf3197e6ac63e013e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
* | Logging: support %{backtrace} in QT_MESSAGE_PATTERNOlivier Goffart2014-07-281-0/+105
| | | | | | | | | | | | | | | | | | | | | | On supported platform, allow to show a backtrace by using %{backtrace} or %{backtrace depth=N separator="|"} [ChangeLog][QtCore][Logging] QT_MESSAGE_PATTERN can include a backtrace using %{backtrace} Change-Id: Ib00418c070d3bd6fe846dc04bf69fa91ba64f9cd Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | Logging: fix support for %{time format} in QT_MESSAGE_PATTERNOlivier Goffart2014-07-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This revert commit de1d5815c15ba1f944752cf7d441442efeb0accb which wrongly fixed a typo. There is no typo because we use startsWith with that constant. Also added a test because the %{time} support was added in commit 93563952d00f865b73136f6a316ca2b8732db85f but the test was missing Change-Id: Ic96e6f21f989ca3a2905ec6c89b93d2627b77b40 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/devFrederik Gladhorn2014-07-041-23/+19
|\ \
| * | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-031-23/+19
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/accessible/qaccessiblecache_mac.mm src/gui/accessible/qaccessiblecache_p.h src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/widgets/kernel/qwidget_qpa.cpp Manually moved change in qwidget_qpa.cpp to qwidget.cpp (cd07830e3b27da7e96a0a83f91ba08c168b45e62) Change-Id: Ia51f471f9b53de2f3b07d77ea89db9303ac8961d
| | * qDebug: fix data race in qt_message_printDavid Faure2014-07-011-23/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The setting of (static) messageHandler to qDefaultMessageHandler if null was happening in multiple threads simultaneously, so it needs synchronization. Used an atomic pointer in case qInstallMessageHandler is called from a thread, but more importantly, initialized the static vars right away. Improve auto test to ensure that qInstallMessageHandler(0) still sets the default message handler. Change-Id: I70335af38c1d28a1cdba1df8a79c6006f227422e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix typo in 'time' message pattern.Gunnar Sletta2014-07-031-1/+1
|/ / | | | | | | | | Change-Id: I3f3861a0307aad9d5bb92c0fdeb719950aa370c8 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* | Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-011-2/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/network/socket/qnativesocketengine_winrt.cpp src/plugins/platforms/android/androidjniaccessibility.cpp src/plugins/platforms/windows/qwindowswindow.cpp Manually adjusted: mkspecs/qnx-armle-v7-qcc/qplatformdefs.h to include 9ce697f2d54be6d94381c72af28dda79cbc027d4 Thanks goes to Sergio for the qnx mkspecs adjustments. Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
| * Doc: qInstallMessageHandler cannot return 0.David Faure2014-06-241-2/+1
| | | | | | | | | | | | | | | | | | The commit 124044613dde9a9596312102ca377bc74ed08165 (in Nov 2011) changed that: the first call will return the builtin message handler, not 0. Change-Id: I535ad69639f2341f9b664a6e2e7b12802ae785e0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Logging: support %{time} and %{time format} in QT_MESSAGE_PATTERNShawn Rutledge2014-06-271-1/+30
| | | | | | | | | | | | | | | | [ChangeLog][QtCore][Logging] QT_MESSAGE_PATTERN can include a timestamp using %{time} or %{time format} Change-Id: I2aaa9c7a6fcb340b5ce9f1fe8a78002e5fc4e6fe Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* | Do not try to handle OOM exceptions in loggingKai Koehne2014-06-061-77/+3
|/ | | | | | | | | | | | | | | We duplicate quite some code here in an attempt to still print messages, even in OOM situations. However, we've in general given up on handling OOM exceptions gracefully in Qt: On modern systems you hardly reach the point of not being able to allocate (smaller) chunks in the first place, since the system will usually overcommit, or bring the system to halt by heavy paging. In 7cafb62538661863e5c we removed already similar logic in QDebug class. Change-Id: I4f84641c41c5e230a60dc0b7a5b0a13dec20f90f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Allow logging to stderrBernd Weimer2014-04-241-6/+30
| | | | | | | | | | | | | | | | | Introduced a new environment variable "QT_LOGGING_TO_CONSOLE". When set on QNX for instance, log output is directed to the console instead of slog2. This can be more convenient when working on the command line. Besides, many declarative auto tests expect that, as well. Marked QT_NO_JOURNALD_LOG and QT_ANDROID_PLAIN_LOG as deprecated, to be replaced with QT_LOGGING_TO_CONSOLE. Change-Id: I7329fa2d10d31506eff145e956eaaa45d94f8e20 Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Use category names when logging to the journalAlejandro Exojo2014-04-051-7/+9
| | | | | | | | | | | | Use the custom field QT_CATEGORY to store the name of the QLoggingCategory used when writing to systemd's journal. To pass custom fields sd_journal_send() is needed, and is used in combination with #define SD_JOURNAL_SUPPRESS_LOCATION to store the metadata that is already in the QMessageLogContext. Change-Id: I6a120701f7012aaa46451dd3d91586a419c5f803 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Document %{if-category} in default message patternKai Koehne2014-03-151-1/+4
| | | | | | | | Commit 15ddb91b introduced %{if-category}, and changed the default message pattern. Adapt the documentation accordingly. Change-Id: I1d500122300c4d62171de3607553b3a5a822d4a7 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix one bogus print to stderr: use toLocal8Bit()Alejandro Exojo2014-03-141-1/+1
| | | | | | Change-Id: I86341ccbd0251a9c858a5e1a9b7ea291d73cda01 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Make QtCriticalMsg exit on QT_FATAL_CRITICALSAlejandro Exojo2014-03-141-0/+5
| | | | | | | Change-Id: I92e8f9851dd074f3bcded6981f5545d1e93b549f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2014-02-111-5/+38
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-071-5/+38
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
| | * QLogging: Avoid infinite loop in error caseEl Mehdi Fekari2014-02-021-5/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user code installs a message handler that uses any API that prints logs (handled by qt_message_print) then this will lead to an infinite loop. This patch adds a thread local storage to check if the message handler is done before the thread is calling it again. Note: This check is performed only if the compiler supports thread_local (__declspec(thread) for MSVC). Change-Id: I43b0460b8f39b26a18de48a5652a5e55f0b336f8 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* | | Fix checking of category for printf-style qCDebugKai Koehne2014-02-081-0/+2
|/ / | | | | | | | | | | | | | | | | | | | | Fixes an issue introduced in b8a38a6737a. We forgot to check for category validness, and printed qCDebug(c, ""...) unconditionally for compilers not supporting variadic macros. Change-Id: I779a97dacd7ea559f0d91473aad2c29e73ea2f89 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2014-01-211-1/+1
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-201-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qstring.cpp src/gui/image/image.pri src/gui/image/qimage.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/qeglfshooks_stub.cpp tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
| | * Windows: Do not print test output to both stdout and system debug logKai Koehne2014-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid piping the test output to both the Windows system debugger, and stdout. This fixes duplicate output in Qt Creator, which displays messages from both sources. [ChangeLog][QtTestLib] The (default) plain text logger on Windows now logs to either the system debug log (in case no console is open), or stdout, not both. Task-number: QTBUG-34630 Change-Id: I35fe9f4a50cc660d79fad7dffa6d19659b2102ae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | | Allow printf style for qCDebug, qCWarning, qCCritical macrosKai Koehne2014-01-211-2/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for using qCDebug and friends in the 'printf style' way. This allows an almost mechanical conversion of existing qDebug, qWarning, qCritical macros, and allows avoiding the size overhead the streaming style incurs (mostly due to inlined QDebug code). To handle this gracefully we require variadic macros (part of C++11/C99). For compilers not supporting variadic macros we fall back to checking the category in QMessageLogger. [ChangeLog][QtCore][Logging] Allow qCDebug macros to be used in a printf style. Change-Id: I5a8fb135dca504e1d621bb67bf4b2a50c73d41b9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Support logging direct to journald, if enabled.Robin Burchell2014-01-211-0/+48
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of merely intercepting logging output from stdout/stderr from the journal side of started processes, this has the advantage of meaning that the origin process name will be correct. fprintf won't work, because if a process starts children (like e.g. a homescreen does), then their stdout/stderr are merged into their parent, and journal has no way of differentiating the origin. We are also able to store information about the context of logging, which might be useful in post-mortem cases. [ChangeLog][Platform Specific Changes][Linux] Systems with systemd may now pass -journald to configure to send logging output to journald. Logging will still be sent to stderr for interactive applications (run from a tty) or with QT_NO_JOURNALD_LOG set to a non-empty value. Change-Id: Ib260cec1ea87390bf44f267d217d795583407d00 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* / Support multiple native surfaces on Android.BogDan Vatra2014-01-171-1/+1
|/ | | | | | | | | | | | | | | | Support for multiple native surfaces is needed by applications that need to mix raster windows with GL windows. Rework the raster and opengl implementation, get rid of eglfs and fbconvenience dependencies. Create a single android platform plugin. [ChangeLog][Android] Rework the raster and opengl implementation. [ChangeLog][Android] Create a single android platform plugin. Task-number: QTBUG-34650 Change-Id: I9b1ab51554823329dda8cfbf8fef27c38f917c7b Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Revert "Add tracing to logging framework"Kai Koehne2013-11-071-2/+0
| | | | | | | | | | | | | | | | | | | The tracing API still misses some real-world exposure. Let's re-do this in dev to have more time. This reverts parts of following commits: 466e0dff4bb686e51d0ab3f905631fcb7dd8bfef 7a47aebe9ed41d6cd9c9bcd45758d4d553668e99 a652bab6a7ebf78b029fea95c2801deb6f4f524a 8f0654ceb878b6c8a08c7f5b790027c26e007c13 4162522edd9d31bd2798ab37f083adff818d886e 32f27b4367c4e042a3f0cda671579494e31c1d69 9ff81bdc1ab4e3d14914192cd63ae625a507fe90 Change-Id: If97340c37b8b3363f597683336a8390d5ff386f1 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Print non-default categories in default message handlerKai Koehne2013-10-161-1/+6
| | | | | | | | | | | | | | | | | | | Change the default output of the logging framework to prefix messages with a 'category: ' in case the category is not "default", so that e.g. QLoggingCategory cat("qt.core.codes.windows"); qCWarning(cat) << "MultiByteToWideChar: Cannot convert multibyte text"; will print qt.core.codes.windows: MultiByteToWideChar: Cannot convert multibyte text while output from qWarning etc will show unaltered output. This should help users to discover categories, and to group output together. Change-Id: Iac2e1514f7dc5671966c36a440a119c857564cfc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Document %{category} for qSetMessagePatternKai Koehne2013-10-151-0/+1
| | | | | | Change-Id: Ib6ad515ce4ba27d501538ba45fd65e60ce5332df Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Let QLoggingCategory::defaultCategory return a pointerhjk2013-10-111-1/+1
| | | | | | | | The pointer can be null. Going trough the reference invokes undefined behavior here. Change-Id: Ia84e4e732cdcbbaee0f5f0679765d18069ea8b2d Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Make sure QLoggingCategory default is availableKevin Ottens2013-10-101-2/+4
| | | | | | | | | | | | This avoids crashes in case where qWarning() would be called from a global static deleted after the one holding the default category. I encountered this case with a QLockFile locked from a global static while the application quits, it was calling qAppName which was triggering a qWarning as the qapplication object was gone too. Change-Id: I8910e8559d063e8f0a737bae3da5edc481ab84d3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Android: Handle new QtTraceMsg in message handlerPaul Olav Tvete2013-09-271-0/+1
| | | | | Change-Id: I3eb6fa42044ff4bdd0219925abf9d18cad60de7c Reviewed-by: hjk <hjk121@nokiamail.com>
* Add tracing to logging frameworkhjk2013-09-251-0/+1
| | | | | | | | | Change-Id: I4d5b9a24a214785019ff1238c1790ead79205b15 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>