diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-09-24 09:55:02 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@digia.com> | 2014-10-01 16:06:27 +0200 |
commit | d78fb442d750b33afe2e41f31588ec94cf4023ad (patch) | |
tree | 15bed899511153580fae3a4cc24ff7dc16260e85 /src/corelib/io/qloggingcategory.h | |
parent | 377ef06aefd66c67c8d65d9e3cb3137b506c6014 (diff) |
Logging: Disable tracking of debug source info for release builds
Tracking the file, line, function means the information has to be stored
in the binaries, enlarging the size. It also might be a surprise to some
commercial customers that their internal file & function names are
'leaked'. Therefore we enable it for debug builds only.
[ChangeLog][QtCore][Logging] File, line, function information are not
recorded anymore for logging statements in release builds. Set
QT_MESSAGELOGCONTEXT explicitly to enable recording in all configurations.
Change-Id: I454bdb42bcf5b5a8de6507f29f2a61109dca9b91
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/corelib/io/qloggingcategory.h')
-rw-r--r-- | src/corelib/io/qloggingcategory.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/io/qloggingcategory.h b/src/corelib/io/qloggingcategory.h index cd3a7bf789..c7e242af08 100644 --- a/src/corelib/io/qloggingcategory.h +++ b/src/corelib/io/qloggingcategory.h @@ -110,15 +110,16 @@ private: static const QLoggingCategory category(__VA_ARGS__); \ return category; \ } + #define qCDebug(category, ...) \ for (bool qt_category_enabled = category().isDebugEnabled(); qt_category_enabled; qt_category_enabled = false) \ - QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO, category().categoryName()).debug(__VA_ARGS__) + QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).debug(__VA_ARGS__) #define qCWarning(category, ...) \ for (bool qt_category_enabled = category().isWarningEnabled(); qt_category_enabled; qt_category_enabled = false) \ - QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO, category().categoryName()).warning(__VA_ARGS__) + QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).warning(__VA_ARGS__) #define qCCritical(category, ...) \ for (bool qt_category_enabled = category().isCriticalEnabled(); qt_category_enabled; qt_category_enabled = false) \ - QMessageLogger(__FILE__, __LINE__, Q_FUNC_INFO, category().categoryName()).critical(__VA_ARGS__) + QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC, category().categoryName()).critical(__VA_ARGS__) #else // defined(Q_COMPILER_VARIADIC_MACROS) || defined(Q_MOC_RUN) |