diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-02-04 16:35:26 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-11 20:59:15 +0100 |
commit | a2bfd114938e1fdd5067f2dac812a8d3a5d89fd3 (patch) | |
tree | 3a0341ab6973bc827c7e2c0f4787f23820d7adb3 /src/corelib/kernel | |
parent | dc09a02e3a4ea93388197d7f8a0cfebe194e9886 (diff) |
Allow configuration of logging rules from file system
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>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index d5d964eaec..f6d4a3b10b 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -55,6 +55,7 @@ #include <qfileinfo.h> #include <qhash.h> #include <qmutex.h> +#include <private/qloggingregistry_p.h> #include <private/qprocess_p.h> #include <qstandardpaths.h> #include <qtextcodec.h> @@ -722,6 +723,10 @@ void QCoreApplication::init() Q_ASSERT_X(!self, "QCoreApplication", "there should be only one application object"); QCoreApplication::self = this; +#ifndef QT_BOOTSTRAPPED + QLoggingRegistry::instance()->init(); +#endif + #ifndef QT_NO_QOBJECT // use the event dispatcher created by the app programmer (if any) if (!QCoreApplicationPrivate::eventDispatcher) |