diff options
author | Kai Koehne <kai.koehne@qt.io> | 2017-05-03 11:42:16 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2017-06-08 08:05:05 +0000 |
commit | 86a948fc0ff124d2ef03956ac507c923cbb262eb (patch) | |
tree | 9a7d06d955aca3c499a42cc019afe065ddf62b80 /src | |
parent | 5441f399af7880f3957751d1601354aaec802666 (diff) | |
download | qtbase-86a948fc0ff124d2ef03956ac507c923cbb262eb.tar.gz |
Document that QLoggingCategory is thread-safe
Task-number: QTBUG-60475
Change-Id: Idced5e1a8ad1d2d28839fd23126a7bf084141eca
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qloggingcategory.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index 967a614a2d..69af936bca 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -63,6 +63,7 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) \class QLoggingCategory \inmodule QtCore \since 5.2 + \threadsafe \brief The QLoggingCategory class represents a category, or 'area' in the logging infrastructure. @@ -95,6 +96,9 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) \li Category names starting with \c{qt} are reserved for Qt modules. \endlist + QLoggingCategory objects implicitly defined by Q_LOGGING_CATEGORY() + are created on first use in a thread-safe manner. + \section1 Checking Category Configuration QLoggingCategory provides \l isDebugEnabled(), \l isInfoEnabled(), @@ -458,6 +462,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if debug output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qDebug() */ @@ -477,6 +483,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if debug output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qDebug() */ @@ -499,6 +507,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if debug output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qInfo() */ @@ -518,6 +528,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if debug output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qInfo() */ @@ -540,6 +552,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if warning output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qWarning() */ @@ -559,6 +573,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if warning output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qWarning() */ @@ -581,6 +597,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if critical output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qCritical() */ @@ -600,6 +618,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if critical output for the category is not enabled, so do not rely on any side effects. + \note Using the macro is thread-safe. + \sa qCritical() */ /*! @@ -624,7 +644,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) \a string identifier. By default, all message types are enabled. Only one translation unit in a library or executable can define a category - with a specific name. + with a specific name. The implicitly defined QLoggingCategory object is + created on first use, in a thread-safe manner. This macro must be used outside of a class or method. */ @@ -640,7 +661,8 @@ void QLoggingCategory::setFilterRules(const QString &rules) and more severe are enabled, types with a lower severity are disabled. Only one translation unit in a library or executable can define a category - with a specific name. + with a specific name. The implicitly defined QLoggingCategory object is + created on first use, in a thread-safe manner. This macro must be used outside of a class or method. It is only defined if variadic macros are supported. |