diff options
Diffstat (limited to 'jobs/basejob.cpp')
-rw-r--r-- | jobs/basejob.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/jobs/basejob.cpp b/jobs/basejob.cpp index 240192d9..7794337e 100644 --- a/jobs/basejob.cpp +++ b/jobs/basejob.cpp @@ -24,7 +24,7 @@ #include <QtNetwork/QNetworkRequest> #include <QtNetwork/QNetworkReply> #include <QtCore/QTimer> -//#include <QtCore/QStringBuilder> +#include <QtCore/QRegularExpression> #include <array> @@ -79,6 +79,13 @@ inline QDebug operator<<(QDebug dbg, const BaseJob* j) return dbg << j->objectName(); } +QDebug QMatrixClient::operator<<(QDebug dbg, const BaseJob::Status& s) +{ + QRegularExpression filter { "(access_token)=[-_A-Za-z0-9]+" }; + return dbg << s.code << ':' + << QString(s.message).replace(filter, "\1=HIDDEN"); +} + BaseJob::BaseJob(HttpVerb verb, const QString& name, const QString& endpoint, const Query& query, const Data& data, bool needsToken) : d(new Private(verb, endpoint, query, data, needsToken)) @@ -331,10 +338,7 @@ void BaseJob::setStatus(Status s) { d->status = s; if (!s.good()) - { - qCWarning(d->logCat) << this << "status" << s.code - << ":" << s.message; - } + qCWarning(d->logCat) << this << "status" << s; } void BaseJob::setStatus(int code, QString message) |