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>
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>
This reverts commit 47cc9e23a3.
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>
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>
newer versions of qt creator understand QMAKE_EXTRA_COMPILERS and
INSTALLS, so there is no need to list the files twice.
Change-Id: Iccf3cc3248daf3422b8c366c2eb2d2f46c5f08d1
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Cleaning out the workarounds for the discontinued "Embedded Android"
platform of Boot2Qt.
Change-Id: I0ff9d770e82a43457fb7e5da0428f4597ead4038
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)
Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
msvc2015 reintroduced a couple of functions from the win32 API
towards WinRT.
Enable usage of those and simplify the file system engine.
Furthermore update the autotests.
Change-Id: I9eafffba0ddfd05917c184c4a6b9e166f86d71d9
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
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>
The qtlogging.ini file needs to be detectable by QFINDTESTDATA,
so we put it in a qrc file on Android.
Change-Id: I5fb0217098c56f2b2e99ab8d1642c4a7904b18d1
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Only accept lower-case "true" and "false", as documented.
The old check didn't match either the documentation, nor the QSettings/
QVariant behavior (where, for a boolean value, any lower-cased content
that not empty, "0" or "false" is considered true).
Change-Id: I317d29c16a27f862001b9dff02e8298df8acf5a6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
The flag is not orthogonal to the rest, and e.g. checking with
flags & Invalid
will fail. Rather make it explicit by comparing with 0.
Change-Id: I428d5e71f5ecd05f61d543aaa78532548ef93d5a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Print a warning when an invalid logging rule is parsed.
Change-Id: I3bf9a6df4053d36b3803652b2faa86168d5222bc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Check also for rules set in an environment variable QT_LOGGING_RULES.
This makes it even more convenient to set rules e.g. for just one run of an
application, without having to create a logging configuration file. It
is also more in place with the current way we enable/disable debugging
of parts of Qt via environment variables.
Change-Id: I4d05976f2b6c12bca472552ffa22345475cd01de
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Tomasz Olszak <olszak.tomasz@gmail.com>
Use QStringRef to speed up the parsing of the left side of logging rules.
Change-Id: Idd4d75496e3865d092f2802c45928a414c14c615
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Do not accept rules with wildcards in the middle.
Change-Id: If6fa71629c46bc4127aa8bd475643bc0e8a9f57c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The documentation says that the left side of a logging rule has the syntax
<category>[.<type>]
with optional wildcard '*' as the first or the last character (or at
both positions.
However, so far we didn't allow
qt.*.debug
But what we did allow is implicit dropping of trailing '.', e.g.
qt.* matched also 'qt'
Fix these by splitting up the '.type' in advance, and then do string
matching only on the 'real' category names.
Change-Id: Iab50ad0fc673464e870f5ab8dfb3245d829b3107
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is more consistent with e.g. qt.conf, where section names also
start with an upper case character.
Change-Id: I9ddaf72baeb9334d081807412512242d5d46cbbf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Allow configuration of logging rules from outside of the application,
either through a configuration file (.config/QtProject/qtlogging.ini),
or through a file specified by a QT_LOGGING_CONF environment
variable.
The logging rules from the different sources are concatenated: First
the rules from QtProject/qtlogging.ini are applied, then
QLoggingCategory::setLoggingRules(), finally from the environment.
This allows an application to overwrite/augment the system wide rules,
and in turn that can be tailored for a specific run by setting a
configuration in the environment variable.
[ChangeLog][QtCore][Logging] The logging framework can now be configured
with an .ini file.
Change-Id: I442efde1b7e0a2ebe135c6f6e0a4b656483fe4b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>