From 752216608d0153cd4181853ad78481887af60c2d Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Mon, 24 Feb 2020 12:19:51 +0100 Subject: QDoc: Use logging category over logToStdErr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ƶ --- src/qdoc/location.cpp | 12 ------------ src/qdoc/location.h | 1 - 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 @@ -357,18 +357,6 @@ void Location::information(const QString &message) fflush(stdout); } -/*! - 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. */ 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); -- cgit v1.2.3