diff options
author | Paul Wicking <paul.wicking@qt.io> | 2020-02-24 12:19:51 +0100 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2020-03-04 10:28:10 +0100 |
commit | 752216608d0153cd4181853ad78481887af60c2d (patch) | |
tree | 08ef18cb6d06bbad74b63ae6a0fadb5d6e9a9598 | |
parent | 9629b11c0b19298663af702dd3801ca31e7c12c3 (diff) | |
download | qttools-752216608d0153cd4181853ad78481887af60c2d.tar.gz |
QDoc: Use logging category over logToStdErr
Use the logging category framework for all log messages that used to be
issued by logToStdErr. Remove the method so that it doesn't suddenly
creep back in.
Change-Id: I7ca1152332e65c3698941f94d63de4a5f34902e7
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r-- | src/qdoc/location.cpp | 12 | ||||
-rw-r--r-- | src/qdoc/location.h | 1 | ||||
-rw-r--r-- | src/qdoc/qdocindexfiles.cpp | 7 |
3 files changed, 3 insertions, 17 deletions
diff --git a/src/qdoc/location.cpp b/src/qdoc/location.cpp index a76a7327a..7178c0f85 100644 --- a/src/qdoc/location.cpp +++ b/src/qdoc/location.cpp @@ -358,18 +358,6 @@ void Location::information(const QString &message) } /*! - Prints \a message to \c stderr followed by a \c{'\n'}, - but only if the -log-progress option is set. - */ -void Location::logToStdErr(const QString &message) -{ - if (logProgress_) { - fprintf(stderr, "LOG: %s\n", message.toLatin1().data()); - fflush(stderr); - } -} - -/*! Report a program bug, including the \a hint. */ void Location::internalError(const QString &hint) diff --git a/src/qdoc/location.h b/src/qdoc/location.h index 242c85067..818984b63 100644 --- a/src/qdoc/location.h +++ b/src/qdoc/location.h @@ -84,7 +84,6 @@ public: static void terminate(); static void information(const QString &message); static void internalError(const QString &hint); - static void logToStdErr(const QString &message); static void startLoggingProgress() { logProgress_ = true; } static void stopLoggingProgress() { logProgress_ = false; } static QString canonicalRelativePath(const QString &path); diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp index 6a09571dd..f51526ab1 100644 --- a/src/qdoc/qdocindexfiles.cpp +++ b/src/qdoc/qdocindexfiles.cpp @@ -32,6 +32,7 @@ #include "config.h" #include "generator.h" #include "location.h" +#include "loggingcategory.h" #include "qdocdatabase.h" #include "qdoctagfiles.h" @@ -109,8 +110,7 @@ void QDocIndexFiles::destroyQDocIndexFiles() void QDocIndexFiles::readIndexes(const QStringList &indexFiles) { for (const QString &file : indexFiles) { - QString msg = "Loading index file: " + file; - Location::logToStdErr(msg); + qCInfo(lcQdoc) << "Loading index file: " << file; readIndexFile(file); } } @@ -1522,8 +1522,7 @@ void QDocIndexFiles::generateIndex(const QString &fileName, const QString &url, if (!file.open(QFile::WriteOnly | QFile::Text)) return; - QString msg = "Writing index file: " + fileName; - Location::logToStdErr(msg); + qCInfo(lcQdoc) << "Writing index file: " << fileName; gen_ = g; QXmlStreamWriter writer(&file); |