diff options
author | Kai Koehne <kai.koehne@digia.com> | 2013-11-04 16:12:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-07 11:29:30 +0100 |
commit | 79b975756a100cc46182c2949e71a683a656bd12 (patch) | |
tree | 970215a813cabe11ebe1445a249adfcad721b43f /src/corelib/io/qloggingcategory.h | |
parent | 0491a7a2984393266e3be48f09b20a8deab9f4c8 (diff) |
Revert "Add tracing to logging framework"
The tracing API still misses some real-world exposure. Let's
re-do this in dev to have more time.
This reverts parts of following commits:
466e0dff4bb686e51d0ab3f905631fcb7dd8bfef
7a47aebe9ed41d6cd9c9bcd45758d4d553668e99
a652bab6a7ebf78b029fea95c2801deb6f4f524a
8f0654ceb878b6c8a08c7f5b790027c26e007c13
4162522edd9d31bd2798ab37f083adff818d886e
32f27b4367c4e042a3f0cda671579494e31c1d69
9ff81bdc1ab4e3d14914192cd63ae625a507fe90
Change-Id: If97340c37b8b3363f597683336a8390d5ff386f1
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/corelib/io/qloggingcategory.h')
-rw-r--r-- | src/corelib/io/qloggingcategory.h | 74 |
1 files changed, 2 insertions, 72 deletions
diff --git a/src/corelib/io/qloggingcategory.h b/src/corelib/io/qloggingcategory.h index da96dee12e..15c0519827 100644 --- a/src/corelib/io/qloggingcategory.h +++ b/src/corelib/io/qloggingcategory.h @@ -44,14 +44,9 @@ #include <QtCore/qglobal.h> #include <QtCore/qdebug.h> -#include <QtCore/qvector.h> QT_BEGIN_NAMESPACE -class QTracer; -class QTraceGuard; -class QLoggingCategoryPrivate; - class Q_CORE_EXPORT QLoggingCategory { Q_DISABLE_COPY(QLoggingCategory) @@ -65,7 +60,6 @@ public: bool isDebugEnabled() const { return enabledDebug; } bool isWarningEnabled() const { return enabledWarning; } bool isCriticalEnabled() const { return enabledCritical; } - bool isTraceEnabled() const { return enabledTrace; } const char *categoryName() const { return name; } @@ -80,66 +74,13 @@ public: static void setFilterRules(const QString &rules); private: - friend class QLoggingCategoryPrivate; - friend class QLoggingRegistry; - friend class QTraceGuard; - friend class QTracer; - - QLoggingCategoryPrivate *d; + void *d; // reserved for future use const char *name; bool enabledDebug; bool enabledWarning; bool enabledCritical; - bool enabledTrace; - // reserve space for future use - bool placeholder1; - bool placeholder2; - bool placeholder3; -}; - -class Q_CORE_EXPORT QTracer -{ - Q_DISABLE_COPY(QTracer) -public: - QTracer() {} - virtual ~QTracer() {} - - void addToCategory(QLoggingCategory &category); - - virtual void start() {} - virtual void end() {} - virtual void record(int) {} - virtual void record(const char *) {} - virtual void record(const QVariant &) {} -}; - -class Q_CORE_EXPORT QTraceGuard -{ - Q_DISABLE_COPY(QTraceGuard) -public: - QTraceGuard(QLoggingCategory &category) - { - target = category.isTraceEnabled() ? &category : 0; - if (target) - start(); - } - - ~QTraceGuard() - { - if (target) - end(); - } - - QTraceGuard &operator<<(int msg); - QTraceGuard &operator<<(const char *msg); - QTraceGuard &operator<<(const QVariant &msg); - -private: - void start(); - void end(); - - QLoggingCategory *target; + bool placeholder[5]; // reserve for future use }; #define Q_DECLARE_LOGGING_CATEGORY(name) \ @@ -162,17 +103,6 @@ private: #define qCCritical(category) \ for (bool enabled = category().isCriticalEnabled(); enabled; enabled = false) \ QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO, category().categoryName()).critical() -#define qCTrace(category) \ - for (bool enabled = category.isTraceEnabled(); Q_UNLIKELY(enabled); enabled = false) \ - QTraceGuard(category) - - -#define Q_TRACE_GUARD_NAME_HELPER(line) qTraceGuard ## line -#define Q_TRACE_GUARD_NAME(line) Q_TRACE_GUARD_NAME_HELPER(line) - -#define qCTraceGuard(category) \ - QTraceGuard Q_TRACE_GUARD_NAME(__LINE__)(category); - #if defined(QT_NO_DEBUG_OUTPUT) # undef qCDebug |