summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorLincoln Ramsay <lincoln.ramsay@nokia.com>2012-04-19 18:22:19 +1000
committerLincoln Ramsay <lincoln.ramsay@nokia.com>2012-04-26 01:29:49 +0200
commit27bf83ee9a211154eb88494ee3e7810d953020f8 (patch)
treeaf0a4e36e4d7eb2a8b3857a39d156f60a6603c76 /doc
parent2d018fa16f4a2a0c05bb7955be3a98948922818e (diff)
Doc update.
Change-Id: Ibb7b814016ab352d57ddf415d52ad73d3229de35 Reviewed-by: Wolfgang Beck <wolfgang.beck@nokia.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/doc.pri2
-rw-r--r--doc/src/index.qdoc61
2 files changed, 27 insertions, 36 deletions
diff --git a/doc/doc.pri b/doc/doc.pri
index 41457fe..3b3bd48 100644
--- a/doc/doc.pri
+++ b/doc/doc.pri
@@ -5,3 +5,5 @@ docs_target.commands = qdoc $$PWD/logger.qdocconf
QMAKE_EXTRA_TARGETS = docs_target
QMAKE_CLEAN += "-r $$PWD/html"
+
+OTHER_FILES += $$PWD/src/*.qdoc
diff --git a/doc/src/index.qdoc b/doc/src/index.qdoc
index e8dbf6d..7e9a32b 100644
--- a/doc/src/index.qdoc
+++ b/doc/src/index.qdoc
@@ -64,17 +64,13 @@
First you need to add the QLogger library dependency to your application:
- LIBS += -lQtLogger
-
- or use
-
- QT+= logger
+ QT += logger
In your application you need to include the QLogger header:
- #include <QtLogger/QtLogger>
+ #include <qlogger.h>
- Note: qDebug, qWarning and qCritical getting redefined in this header so make sure that the QLogger header gets included after qlogging.h.
+ Note: qDebug, qWarning and qCritical are re-defined by this header.
\section2 Creating Logging Rules
\target logging_rules
@@ -125,26 +121,22 @@
\endtable
- The logging rule file can be defined by using the environment variable QT_LOGGING_CONFIG.
- The application developer can set the rule file by using:
-
-
- qSetLoggingRulesFile(const QString &path)
-
-
- or by defining a QByteArray containing the rules and call:
-
+ The logging rule file can be defined by using the environment variable \l QT_LOGGING_CONFIG.
+ The application developer can set the rule file by using \l qSetLoggingRulesFile() or can
+ set the rules directly using \l qSetLoggingRules().
- qSetLoggingRules(const QByteArray &configcontent)
+ If there is no configuration available, the \l {Default settings} will be used.
+ \section2 QT_LOGGING_CONFIG
- If there is no configuration available logging will not be performed.
- Note: QT_LOGGING_CONFIG will overwrite the qSetLoggingRulesFile and qSetLoggingRules calls.
+ The QT_LOGGING_CONFIG environment variable overrides both qSetLoggingRulesFile() and
+ qSetLoggingRules() if it points to a file.
+ If QT_LOGGING_CONFIG is relative, QStandardPaths::writeableLocation(QStandardPaths::ConfigLocation) will be prepended.
\section2 Logging usage in your project
- Qt provides a macro to create your logging Categories:
+ Qt provides the \l QT_LOG_CATEGORY() macro to create your logging Categories:
\snippet logger/main.cpp 1
@@ -165,28 +157,25 @@
In this example the configuration file "mylogging.cfg" is in the current directory.
- A category logging can be done by using the qCDebug(<category>), qCWarning(<category>) or the qCCritical(<category>) macro.
+ For category-based logging statements, you need to use the \l qCDebug(), \l qCWarning() and \l qCCritical() macros.
\snippet logger/main.cpp 3
\section1 Default settings
- If there is no logging rules defined "debug" subcategories are disabled but "warning" and "critical" are enabled.
+ The defaults are as follows.
+ \table
+ \header \li Statement \li Default
+ \row \li qDebug \li Enabled
+ \row \li qWarning \li Enabled
+ \row \li qCritical \li Enabled
+ \row \li qCDebug \li Disabled
+ \row \li qCWarning \li Enabled
+ \row \li qCCritical \li Enabled
+ \endtable
- \section1 Functions
-
-
- \section2
- qSetLoggingRules(const QByteArray &rules)
-
- Set the logging rules with the given \a rules byte array.
-
-
- \section2
- qSetLoggingRulesFile(const QString &path)
+ In other words, only \l qCDebug() statements are hidden by default.
- Set the config file with the given \a path which contains the logging rules for category logging.
- The parameter \a path can contain only the file name.
- In this case the standard path for configuration files QStandardPaths will be used.
+ \sa QLogging
*/