From 7552d94d31e48a70ea92df9b5235a6e0834d44f5 Mon Sep 17 00:00:00 2001 From: Wolfgang Beck Date: Mon, 16 Jan 2012 17:45:23 +1000 Subject: Prepare category logging for Qt integration Change-Id: I0c784a945fe87d7ba52a44f5c7246de1709ae888 Reviewed-by: Lincoln Ramsay Reviewed-by: Peter Yard Reviewed-by: Alex --- src/corelib/global/qlogging.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/corelib/global/qlogging.h') diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h index 4de04bdc33..29313bd582 100644 --- a/src/corelib/global/qlogging.h +++ b/src/corelib/global/qlogging.h @@ -66,15 +66,17 @@ class QMessageLogContext { Q_DISABLE_COPY(QMessageLogContext) public: - QMessageLogContext() : version(1), line(0), file(0), function(0) {} - Q_DECL_CONSTEXPR QMessageLogContext(const char *fileName, int lineNumber, - const char *functionName) - : version(1), line(lineNumber), file(fileName), function(functionName) {} + QMessageLogContext() : version(1), line(0), file(0), function(0), category(0) {} + Q_DECL_CONSTEXPR QMessageLogContext(const char *fileName, int lineNumber, const char *functionName, const char *categoryName) + : version(1), line(lineNumber), file(fileName), function(functionName), category(categoryName) {} + + void copy(const QMessageLogContext &logContext); int version; int line; const char *file; const char *function; + const char *category; private: friend class QMessageLogger; @@ -87,7 +89,9 @@ class Q_CORE_EXPORT QMessageLogger public: QMessageLogger() : context() {} Q_DECL_CONSTEXPR QMessageLogger(const char *file, int line, const char *function) - : context(file, line, function) {} + : context(file, line, function, "default") {} + Q_DECL_CONSTEXPR QMessageLogger(const char *file, int line, const char *function, const char *category) + : context(file, line, function, category) {} void debug(const char *msg, ...) #if defined(Q_CC_GNU) && !defined(__INSURE__) -- cgit v1.2.3