summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qloggingregistry.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QLoggingRule: default initialize 'messageType' memberDennis Oberst2024-04-111-5/+2
| | | | | | | | Fixes Axivion(SV70928): Qt-Generic-InitializeAllFieldsInConstructor Task-number: QTBUG-122619 Change-Id: Ida5ed45c6bce30541fb268f7aeb4339eca2f4dbe Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Be more verbose if QT_LOGGING_DEBUG is setKai Köhne2024-02-201-9/+29
| | | | | | | Pick-to: 6.7 Fixes: QTBUG-121380 Change-Id: Ieb977ada03aa0128cbaeee796f42508fd6db4031 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* QLoggingRegistry: cut out the QMap middle-manMarc Mutz2024-02-171-2/+2
| | | | | | | | | | | | | | | | | | | In Qt 6, QMap is just a shared pointer to a std::map. QLoggingRegistry::qtCategoryEnvironmentOverrides is never copied, though, so the implicit sharing that QMap adds on top of std::map is useless. Use the underlying std::map directly. Yes, the std::map API is a bit raw around the edges (std::pair value_type), but we're professionals here. This saves more than 1.1KiB in TEXT size on optimized AMD64 GCC 11 C++20 Linux builds. Change-Id: Id72b2432ed41a97700cc2d9ecafa902b919efe84 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLoggingRegistry: further defend against non-NUL-terminated stringsMarc Mutz2024-02-171-3/+3
| | | | | | | | | | | | | | | | | Various functions in QLoggingRegistry took QByteArrayView, but they continued to assume that the data was NUL-terminated (converting back to const char* by calling data()). Make sure only NUL-terminated strings are passed by taking in the tranditional way, as const char*. Keep QByteArrayView when storing in the map as key, to avoid comparing just pointer values (as opposed to the string content). Amends 806545fcc8d6b3b96a5191a00a31e9a39837189c. Pick-to: 6.7 6.6 6.5 Change-Id: I232167d4c91070369e770c41d3ea53bd2406a03f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Misc: Fix qsizetype-related narrowing coversionsAhmad Samir2023-03-111-2/+2
| | | | | | Task-number: QTBUG-102461 Change-Id: I96757abc50fc45756bc1271a970f819a48021663 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QSettingsPrivate: fold from/to parameters into the view they boundEdward Welbourne2022-03-301-2/+2
| | | | | | | | | | Two methods of the private class used to take a QByteArray with from and to indices into it, for where to start and stop a scan. Now that they take a QByteArrayView, those parameters can be used by the caller to shorten the view to the desired portion. Change-Id: Id1586afb87a9e8a189b69e485278375ff504fb7b Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QtCore: Replace remaining uses of QLatin1String with QLatin1StringViewSona Kurazyan2022-03-261-2/+2
| | | | | | | Task-number: QTBUG-98434 Change-Id: Ib7c5fc0aaca6ef33b93c7486e99502c555bf20bc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QtCore: replace QLatin1String/QLatin1Char with _L1/u'' where applicableSona Kurazyan2022-03-251-15/+18
| | | | | | | | | | | As a drive-by, did also minor refactorings/improvements. Task-number: QTBUG-98434 Change-Id: I81964176ae2f07ea63674c96f47f9c6aa046854f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* Deprecate {QString, QByteArray}::count()Sona Kurazyan2022-03-121-1/+1
| | | | | | | | | | | | And remove their uses. [ChangeLog][QtCore][Deprecation Notice] Deprecated QString::count() and QByteArray::count() that take no parameters, to avoid confusion with the algorithm overloads of the same name. They can be replaced by size() or length() methods. Change-Id: I6541e3235ab58cf750d89568d66d3b1d9bbd4a04 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLoggingRegistry: avoid double-lookupMarc Mutz2021-11-191-2/+5
| | | | | | | | | | | | | The code used the if (!contains()) { insert() } anti-pattern, necessitated by Qt's deviation from the STL of allowing insert() to overwrite an existing entry, causing two lookups of the same key. Fix by recording the size prior to the execution of the indexing operator and taking a size increase as the cue to populate the (new) entry. This way, we look up the key only once. Change-Id: Ica039035fe9ea4b88c20184784c324c9fac33d49 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QLoggingRegistry: Disable internal tracking of source file namesThiago Macieira2021-10-271-3/+2
| | | | | | | | | | Commit d78fb442d750b33afe2e41f31588ec94cf4023ad (5.4) did this for all regular users of our macros, but obviously missed this manual override. So apply here too. Change-Id: I8c6a0ff3ec184205a544fffd16af7734fed2ebd1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLoggingRegistry: add the ability to have environment variable overridesThiago Macieira2021-10-271-1/+23
| | | | | | | | | | | Quite a lot of our code in Qt predating QLoggingCategory has manual environment variable controls. For compatibility with established documentation and tips-and-tricks out there, we should keep them working when switching to categorized logging. Change-Id: I3eb1bd30e0124f89a052fffd16a6c151d3e9d552 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* corelib: Fix typos in documentationJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 5.15 6.2 Change-Id: I64d63af708bc6ddaabd12450eb3089e5077f849e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QLoggingSettingsParser: port setContent() to QStringViewMarc Mutz2021-06-161-3/+3
| | | | | | | | | | | Amends 16f927a4f1ffeff399351b625d73ac3cd7bccd51. At the time the original change was written, QStringTokenizer had not been integrated, yet. Change-Id: I83c31d816199bc48c4baea855d13cbf9eda9aaa2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Rename QLibraryInfo::location() to path()Lars Knoll2020-09-121-1/+1
| | | | | | | | As per ### Qt6 comment. Also rename the LibraryLocation enum to LibraryPath. Change-Id: I556025a19c5bcdf2ff52598eaba32269522d4128 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLoggingRegistry: remove an always true testGiuseppe D'Angelo2020-06-301-2/+1
| | | | | | | | idx has already been tested for being >=0, so it's pointless retesting it. Change-Id: I2f5d7e1b7a70097de2601c1ed83752f6aa707cd9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QList instead of QVector in corelib implementationJarek Kobus2020-06-291-3/+3
| | | | | | | | Omitting state machine and docs for now. Task-number: QTBUG-84469 Change-Id: Ibfa5e7035515773461f6cdbff35299315ef65737 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Port remaining usages of QStringRef in QtCore to QStringViewLars Knoll2020-06-121-1/+1
| | | | | | Task-number: QTBUG-84319 Change-Id: If77bc94c18e8d522b4577050091cd7d7aa941311 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLoggingRegistry: use QStringView/QLatin1String moreMarc Mutz2020-03-051-22/+18
| | | | | | | | | | | | | | | | | - QLoggingRule::parse() and the ctor take pattern as QStringView - parseNextLine takes lines as QStringView and produces the pattern as QStringView for QLoggingRule - (setContent has to wait for QStringTokenizer) - QLoggingRule::pass()'s first argument is always QLatin1String, so take it as one Use chopped() more, add a std::move(). Change-Id: Ic95ea77464a9922fef452846bc6d5053bd5de56e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtCore: port all QMutexLocker users to qt_{scoped,unique}_lockMarc Mutz2019-08-251-3/+4
| | | | | | | | | | | | | | | | ... except four instances in QCoreApplication that would conflict with another change. Replace a locally-defined MutexUnlocker with a call to unlock() + qScopedGuard'ed lock() to avoid having to spell out the locker type while we can't depend on C++17 CTAD, yet. In QSettings, move the new mutex locker into and out of initDefaultPaths(), such as is idiomatic for std::unique_lock, but wasn't possible with QMutexLocker (which is not movable). Change-Id: I23056e13ecaa76159db583c7dccc6e05715e0788 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Move away from using 0 as a pointer constantAllan Sandfeld Jensen2019-06-071-2/+2
| | | | | | | | | Cleans up most of corelib to use nullptr or default enums where appropriate. Change-Id: Ifcaac14ecdaaee730f87f10941db3ce407d71ef9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Logging: Accept .ini files written by QSettingsKai Koehne2018-07-281-1/+13
| | | | | | | | | | | | | | | | | | | | | | | For keys, QSettings escapes all characters outside of [-a-zA-Z0-9_.] by using percent encoding, and changes '/' to '\'. That is, settings.setValue("qt.*", true) will be written to an .ini file as qt.%2A=true This means that QSettings can not be used to write general-purpose qtlogging.ini files. Fix this by applying the reverse transformation method from QSettings when reading in the .ini file. [ChangeLog][Logging] Qt will now accept qtlogging.ini files written by QSettings. Task-number: QTBUG-69548 Change-Id: I55b7a8b433291268dc6855901f72b1c04f8ee6d3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Defer initialization of logging rules until qApp constructionTor Arne Vestbø2018-02-071-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Android, we load the application library, and its dependencies (Qt), on Android's main thread (thread 0), and then spin up a secondary thread (thread 1), that we call main() on. If any QObject is constructed during loading of the application library or any of Qt's libraries, via static initializers or constructor functions, we will set QCoreApplicationPrivate::theMainThread to thread 0, which will confuse Qt later on when it's being run on thread 1, and will result in a warning during QCoreApplication construction: QApplication was not created in the main() thread This situation can easily lead to a crash as well. Unfortunately logging via qDebug/qCDebug and friends will trigger this too, as they internally use QObject. Fixing the root cause of this is under investigation, but for now we will partially revert fa2a653b3b934783 for Android. The effect is that any qCDebug with a "qt.*" category before qApp construction will turn into a no-op, like it was before fa2a653b3b934783. This patch does not cover the case of a regular qDebug, or a qCDebug with a non-Qt category. Those will still produce the same symptom, as before fa2a653b3b934783. Task-number: QTBUG-65863 Change-Id: I95675731d233244530d0a2a1c82a9578d5599775 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 538b1b50764fb3a1898d425a7155319afbcf3b25)
* Fix typoOliver Wolff2017-12-131-2/+2
| | | | | Change-Id: If6111c59b958ba03f6ec5966af5cf443cae5cf9b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Initialize QLoggingRegistry rules on first useTor Arne Vestbø2017-11-251-1/+2
| | | | | | | | | | Allows categorized logging before QCoreApplication has been created, which otherwise would silently fail to output anything because the category would never be enabled, despite QT_LOGGING_RULES being set. Change-Id: I1861e5366ea980dff2ffa753b137276c77278eee Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QLoggingRegistry: remove rules vectorMarc Mutz2017-04-211-28/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It only contained a concatenation of the individual rule sets, probably to fix their order in a central place, as well as simplifying iteration in defaultCategoryFilter(). Fix these two issues differently, but introducing a RuleSet enum that lists rule sets in the order in which they should be applied by defaultCategoryFilter(), and turn individual rule sets vectors into a C array of vectors. This enables two nested loops in defaultCategoryFilter to replace the one loop over 'rules'. Apart from building up 'rules' in updateRules(), this was the only access to that member. That leaves updateRules() with just the task of running defaultCategoryFilter() on the new rule sets. Consequently, a call to updateRules() can now replace the identical loop in installFilter(). Performance should not suffer. Iterating over a fixed-size array of vectors is hardly any slower than iterating over a single vector, and while the construction of 'rules' was probably a one-off task in most programs, this way of keeping the rules also saves memory because rules are not kept in two different vectors. It is also more maintainable, of course. Change-Id: Ibc132d096c8137dd02b034752646212e51208637 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Revert "Initialize QLoggingRegistry rules on first use, not qApp construction"Tor Arne Vestbø2017-04-191-1/+0
| | | | | | | | | | | | | This reverts commit 47cc9e23a313d67a4a3107242f205d2473842021. We use QCoreApplication::applicationDirPath in the logging initialization to find a possible qtlogging.ini file. Because QCoreApplication::applicationDirPath requires a QCoreApplication instance this leads to a qWarning, which in turn leads to a recursive call to the logging initialization, and in turn to a recursive mutex deadlock. Task-number: QTCREATORBUG-18031 Change-Id: Ic75e1e8c062eb647991725378489bf87c9648cca Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Initialize QLoggingRegistry rules on first use, not qApp constructionTor Arne Vestbø2017-04-181-0/+1
| | | | | | | | | Allows categorized logging before QCoreApplication has been created, which otherwise would silently fail to output anything because the category would never be enabled, despite QT_LOGGING_RULES being set. Change-Id: Ia733105c5b6f28e22af511ced5271e45782da12b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Optimize QLoggingSettingsParserMarc Mutz2017-04-101-37/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor the line parsing into a separate function, parseNextLine(), taking a QStringRef. In setContent(QTextStream&), use the new readLineInto() function to re-use the capacity of a single QString for all lines. In setContent(QString), use splitRef() to split the lines. In either function, pass each line to parseNextLine(). In order to port all the parsing to QStringRef, I needed to make some semantic changes: the old code removed all whitespace right at the beginning. This is not possible with QStringRef. It also didn't feel right, since a line like [ r u l e s ] would successfully parse as the section named "rules". I added trimmed() calls at the beginning, and around the valueStr and pattern extraction, which should be good enough. Also, when a section is found, don't store it anymore. Instead, only store whether it was the [rules] section, because that's all we'll test for. That way, we don't have to convert QStringRefs to QString just to store them across parseNextLine() calls. Replace the setSection() function with setImplicitRulesSection(), because "rules" is all that was ever passed. This is private API, we can bring back some of the dropped flexibility later, as needed. [ChangeLog][Important Behavior Changes] Logging rules can no longer contain arbitrary whitespace such as within a category identifier. Change-Id: Ic26cd23c71f5c810b37ef4b972354ac31d3408fe Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Use case-insensitive compare moreAnton Kudryavtsev2017-03-291-1/+1
| | | | | | | | ... to avoid allocations. Change-Id: I5993633d1509495ff6ce3a11274a53504aac7c5e Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-241-7/+15
|\ | | | | | | | | | | | | Conflicts: mkspecs/features/moc.prf Change-Id: Ia71c8e3b3185f7c999bf226d0675051b10b8740b
| * QLoggingRegistry: fix potential data raceMarc Mutz2017-02-201-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'rules' vector is made up of all the individual {env,config,...}Rules vectors under mutex protection whenever init() is called (only from the QCoreApplication ctor) or, at any time, by a call to QLoggingCategory:: setFilterRules(). Yet, the writes to the individual *Rules vectors were never protected by registryMutex, racing against the reads of the same vectors in the updateRules() function. Fix by protecting all access of all member variables with registryMutex. Add some strategic comments to make analysis easier for the next guy. Change-Id: If68d15a553ec7038693574a34f10a39f4cd480e8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QLoggingRegistry: optimize updateRules()Marc Mutz2017-02-071-1/+6
|/ | | | | | | | | | | | | | ... by not creating three temporary QVectors just to concatenate them. There's no QVectorBuilder, so what works well with QStrings doesn't work well at all with QVectors. The chaining of op+ causes three temporary QVectors to be created and thrown away. Instead, use clear() (which preserves the vector's capacity these days), followed by four op+=. Change-Id: I300bd35544ea41037d28db0f48f210c33c826b85 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-271-3/+0
|\ | | | | | | | | | | | | | | Conflicts: src/corelib/io/qprocess_win.cpp src/widgets/itemviews/qheaderview.cpp Change-Id: I0a59ade9cd6e91f770fdf298a7d72a41e79fd761
| * Also update filter rules if there is a custom filter installed.Volker Krause2016-04-241-3/+0
| | | | | | | | | | | | | | | | | | This is relevant if the custom filter passes through some categories to the previous one (which might be the default one). In this case changes to the filter rules never took effect. Change-Id: I1a3ab569857d43621ce5df4e690c6e64e6bc7a66 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QtCore: eradicate all Q_FOREACH loops [io]Marc Mutz2016-01-041-2/+2
| | | | | | | | | | | | | | | | Saves more than 1KiB in text size on optimized GCC 4.9 Linux AMD64 builds. Change-Id: I1a974e903bc8352af800fa26edae0194c1e51705 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QLoggingRegistry: don't iterate over QHash::keys()Marc Mutz2015-12-281-4/+4
|/ | | | | | | | | | | ... but use the new key_iterators instead. Saves creating a temporary QList just to iterate over it and ~1.3KiB in text size on optimized GCC 4.9 Linux AMD64 builds. Change-Id: Id5223fc5fcb4a4e7c012718c1bb2674b8ea0439d Reviewed-by: Sérgio Martins <iamsergio@gmail.com>
* QLoggingRegistry: Look up logging configuration in Qt data pathKai Koehne2015-08-241-29/+35
| | | | | | | | | | | | | | | | Distributions like Fedora would like to disable logging globally, without having to patch Qt. Fedora right now therefore adds a /etc/xdg/qtlogging.ini file, which unfortunately though also messes with Qt versions compiled by the user. This patch lets QLoggingRegistry look up logging configurations also in QLibraryInfo::DataPath, which would allow to tweak the values per Qt installation. See also https://bugzilla.redhat.com/show_bug.cgi?id=1227295 Change-Id: I0fca304a47f45739d0c08a9e4e715673bf10aa80 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devFrederik Gladhorn2015-08-061-3/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/qt-cpp-defines.qdocconf src/3rdparty/forkfd/forkfd.c src/corelib/codecs/qtextcodec.cpp src/corelib/kernel/qmetatype.cpp src/corelib/tools/qset.qdoc src/gui/accessible/qaccessible.cpp src/gui/image/qpixmapcache.cpp src/opengl/qgl.cpp src/tools/qdoc/generator.cpp src/widgets/kernel/qwidget.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I4fbe1fa756a54c6843aa75f4ef70a1069ba7b085
| * QLoggingCategory: fix default severity in Q_LOGGING_CATEGORY macroAlex Merry2015-08-031-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QLoggingCategory] Fixed behavior of default severity passed to constructor or Q_LOGGING_CATEGORY with regards to QtInfoMsg, which was previously treated as being more severe than QtFatalMsg. This is because the code was using the numeric value of QtMsgType as a proxy for severity (via the <= operator), but the value of QtInfoMsg is greater than QtFatalMsg. Instead, the severity ordering must be dealt with explicitly. Change-Id: I5f178afc735221b00cb67c2cea4fa964bd9079ce Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | QLoggingRegistry: allow Rules section to be lower caseFrederik Gladhorn2015-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | In http://blog.qt.io/blog/2014/03/11/qt-weekly-1-categorized-logging/ the Rules section is given as: [rules] ... While in reality only Rules was accepted. Ignore casing instead. Change-Id: Ibf0da6b6df857988d508ba9ec354cbce0b2c56d6 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into HEADSimon Hausmann2015-07-171-13/+16
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsopengltester.cpp Change-Id: Ia7abeba9395ccf84e2fa81b91a5725a86dedb9fe
| * Add warning for malformed logging ruleTasuku Suzuki2015-07-161-13/+16
| | | | | | | | | | Change-Id: I58ccbb77e5ab62e4114a271f199797dd1307a676 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | QT_LOGGING_RULES supports multiple rules separated by semicolonsTasuku Suzuki2015-07-161-1/+1
|/ | | | | | | | | [ChangeLog][QtCore][Logging] QT_LOGGING_RULES now supports multiple rules separated by semicolons Change-Id: I7fdd62a3d719aeb16cad54f193befb6c203bc160 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Add QtInfoMsgKai Koehne2015-01-091-1/+10
| | | | | | | | | | | | | | Add an 'info' message type that can be used for messages that are neither warnings (QtWarningMsg), nor for debugging only (QtDebugMsg). This is useful mainly for applications that do not have to adhere to the 'do not print anything by default' paradigm that we have for the Qt libraries itself. [ChangeLog][QtCore][Logging] QtInfoMsg got added as a new QtMsgType. Use the new qInfo(), qCInfo() macros to log to it. Change-Id: I810995d63de46c41a9a99a34d37c0d417fa87a05 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Fix undefined behavior in QLoggingRegistry::defaultCategoryFilter()Marc Mutz2014-10-171-3/+5
| | | | | | | | | | | | | | | | | | | | | | Report by asan: READ of size 2 at 0x00000041dd40 thread T0 #0 0x2af097b84da6 in QLoggingRegistry::defaultCategoryFilter(QLoggingCategory*) (lib/libQt5Core.so.5+0x566da6) #1 0x2af097b8387b in QLoggingRegistry::registerCategory(QLoggingCategory*, QtMsgType) (lib/libQt5Core.so.5+0x56587b) #2 0x4067f7 in tst_QLogging::QLoggingCategory_categoryName() tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp:238 <snip> 0x00000041dd41 is located 0 bytes to the right of global variable '*.LC115' defined in 'tests/auto/corelib/io/qloggingcategory/tst_qloggingcategory.cpp' (0x41dd40) of size 1 '*.LC115' is ascii string '' At face value, memcmp("", "qt", 2) should not return 0, but since the code invokes undefined behavior, the compiler can do whatever it wants, including returning 0 here, further proving the fact that there are *no* benign cases of undefined behavior. Change-Id: I0c38622c47d1dcea450ea549370be1673b47b18d Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Removing a few unneeded "? true : false"Alessandro Portale2014-10-091-3/+3
| | | | | | | Change-Id: Ib13f0ddd65fe78f5559f343f2fc30756b1d3ef76 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>