summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qloggingcategory.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qloggingcategory.h')
-rw-r--r--src/corelib/io/qloggingcategory.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/corelib/io/qloggingcategory.h b/src/corelib/io/qloggingcategory.h
index 5e0082e2aa..1b6ce688cb 100644
--- a/src/corelib/io/qloggingcategory.h
+++ b/src/corelib/io/qloggingcategory.h
@@ -67,11 +67,6 @@ template <QtMsgType Which> struct QLoggingCategoryMacroHolder
if (IsOutputEnabled)
init(cat);
}
- explicit QLoggingCategoryMacroHolder(QMessageLogger::CategoryFunction catfunc)
- {
- if (IsOutputEnabled)
- init(catfunc());
- }
void init(const QLoggingCategory &cat) noexcept
{
category = &cat;
@@ -108,6 +103,9 @@ template <> const bool QLoggingCategoryMacroHolder<QtWarningMsg>::IsOutputEnable
#endif
} // unnamed namespace
+#define QT_DECLARE_EXPORTED_QT_LOGGING_CATEGORY(name, export_macro) \
+ export_macro Q_DECLARE_LOGGING_CATEGORY(name)
+
#define Q_DECLARE_LOGGING_CATEGORY(name) \
const QLoggingCategory &name();
@@ -121,8 +119,11 @@ template <> const bool QLoggingCategoryMacroHolder<QtWarningMsg>::IsOutputEnable
return category; \
}
+#define Q_STATIC_LOGGING_CATEGORY(name, ...) \
+ static Q_LOGGING_CATEGORY(name, __VA_ARGS__)
+
#define QT_MESSAGE_LOGGER_COMMON(category, level) \
- for (QLoggingCategoryMacroHolder<level> qt_category(category); qt_category; qt_category.control = false) \
+ for (QLoggingCategoryMacroHolder<level> qt_category((category)()); qt_category; qt_category.control = false) \
QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, qt_category.name())
#define qCDebug(category, ...) QT_MESSAGE_LOGGER_COMMON(category, QtDebugMsg).debug(__VA_ARGS__)