diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qloggingcategory.cpp | 14 | ||||
-rw-r--r-- | src/corelib/io/qloggingregistry.cpp | 8 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index 8c3ca5fd65..9ddf58b5ea 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -83,9 +83,8 @@ Q_GLOBAL_STATIC_WITH_ARGS(QLoggingCategory, qtDefaultCategory, \section1 Default category configuration - In the default configuration \l isWarningEnabled() and \l isCriticalEnabled() - will return \c true. \l isDebugEnabled() will return \c true only - for the \c "default" category. + In the default configuration \l isWarningEnabled() , \l isDebugEnabled() and + \l isCriticalEnabled() will return \c true. \section1 Changing the configuration of a category @@ -111,21 +110,20 @@ Q_GLOBAL_STATIC_WITH_ARGS(QLoggingCategory, qtDefaultCategory, QLoggingCategory::QLoggingCategory(const char *category) : d(0), name(0), - enabledDebug(false), + enabledDebug(true), enabledWarning(true), enabledCritical(true) { Q_UNUSED(d); Q_UNUSED(placeholder); - bool isDefaultCategory + const bool isDefaultCategory = (category == 0) || (strcmp(category, qtDefaultCategoryName) == 0); + // normalize "default" category name, so that we can just do + // pointer comparison in QLoggingRegistry::updateCategory if (isDefaultCategory) { - // normalize default category names, so that we can just do - // pointer comparison in QLoggingRegistry::updateCategory name = qtDefaultCategoryName; - enabledDebug = true; } else { name = category; } diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp index a82e6f65f4..fd25ff697e 100644 --- a/src/corelib/io/qloggingregistry.cpp +++ b/src/corelib/io/qloggingregistry.cpp @@ -283,9 +283,13 @@ QLoggingRegistry *QLoggingRegistry::instance() */ void QLoggingRegistry::defaultCategoryFilter(QLoggingCategory *cat) { - // QLoggingCategory() normalizes all "default" strings + // QLoggingCategory() normalizes "default" strings // to qtDefaultCategoryName - bool debug = (cat->categoryName() == qtDefaultCategoryName); + bool debug = true; + char c; + if (!memcmp(cat->categoryName(), "qt", 2) && (!(c = cat->categoryName()[2]) || c == '.')) + debug = false; + bool warning = true; bool critical = true; |