diff options
author | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2012-04-19 18:22:19 +1000 |
---|---|---|
committer | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2012-04-26 01:29:49 +0200 |
commit | 27bf83ee9a211154eb88494ee3e7810d953020f8 (patch) | |
tree | af0a4e36e4d7eb2a8b3857a39d156f60a6603c76 /src | |
parent | 2d018fa16f4a2a0c05bb7955be3a98948922818e (diff) |
Doc update.
Change-Id: Ibb7b814016ab352d57ddf415d52ad73d3229de35
Reviewed-by: Wolfgang Beck <wolfgang.beck@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/logger/qlogger.cpp | 74 | ||||
-rw-r--r-- | src/logger/qlogger.h | 5 |
2 files changed, 79 insertions, 0 deletions
diff --git a/src/logger/qlogger.cpp b/src/logger/qlogger.cpp index 196b973..539c523 100644 --- a/src/logger/qlogger.cpp +++ b/src/logger/qlogger.cpp @@ -131,6 +131,19 @@ namespace QLoggingCategories } } +/*! + \namespace QLogging +*/ + +/*! + \relates QLogging + Load logging rules from \a path. + + If \a path is relative, QStandardPaths::writeableLocation(QStandardPaths::ConfigLocation) will be prepended. + + Note that if the QT_LOGGING_CONFIG environment variables points to a file, this function does nothing. + \sa QT_LOGGING_CONFIG +*/ void qSetLoggingRulesFile(const QString &path) { if (gEnvironment == EnvironmentNotChecked) checkEnvironment(); @@ -140,6 +153,16 @@ void qSetLoggingRulesFile(const QString &path) qLogging()->setLoggingRulesFile(config); } +/*! + \relates QLogging + Set logging \a rules directly. + + This is primarily intended for applications that wish to provide runtime control of their + logging rather than relying on the user providing a configuration file. + + Note that if the QT_LOGGING_CONFIG environment variables points to a file, this function does nothing. + \sa QT_LOGGING_CONFIG +*/ void qSetLoggingRules(const QByteArray &rules) { if (gEnvironment == EnvironmentNotChecked) checkEnvironment(); @@ -149,6 +172,57 @@ void qSetLoggingRules(const QByteArray &rules) } /*! + \relates QLogging + \macro qCDebug(cat) + Works like qDebug() but only prints out if \a cat has been enabled. + \code + qCDebug(CAT) << "my message"; + \endcode + \sa QT_LOG_CATEGORY(), {Creating Logging Rules} +*/ + +/*! + \relates QLogging + \macro qCWarning(cat) + Works like qWarning() and can be disabled with \a cat. + \code + qCWarning(CAT) << "my message"; + \endcode + \sa QT_LOG_CATEGORY(), {Creating Logging Rules} +*/ + +/*! + \relates QLogging + \macro qCCritical(cat) + Works like qCritical() and can be disabled with \a cat. + \code + qCCritical(CAT) << "my message"; + \endcode + \sa QT_LOG_CATEGORY(), {Creating Logging Rules} +*/ + +/*! + \relates QLogging + \macro QT_LOG_CATEGORY(cat, identifier) + Registers a logging category with local identifier \a cat and complete identifier \a identifier. + + This macro must be used outside of a class or method. + \sa {Logging usage in your project} +*/ + + + + + + + + + + + + + +/*! \internal QLoggingPrivate constructor */ diff --git a/src/logger/qlogger.h b/src/logger/qlogger.h index 400dccc..ce06201 100644 --- a/src/logger/qlogger.h +++ b/src/logger/qlogger.h @@ -66,6 +66,11 @@ namespace QLoggingCategories { Q_LOGGER_EXPORT bool isEnabled(); } +// This is here so that QDoc has something to attach the functions +// and macros to. +namespace QLogging { +} + Q_LOGGER_EXPORT void qSetLoggingRules(const QByteArray &rules); Q_LOGGER_EXPORT void qSetLoggingRulesFile(const QString &path); |