Skip to content

Commit 33fdd99

Browse files
committed
qt: Change serious messages from qDebug to qWarning
By changing the logging stream for warnings from qDebug to qWarning, these will always be logged to debug.log.
1 parent d95ba75 commit 33fdd99

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

src/qt/addresstablemodel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class AddressTablePriv
114114
case CT_NEW:
115115
if(inModel)
116116
{
117-
qDebug() << "AddressTablePriv::updateEntry : Warning: Got CT_NEW, but entry is already in model";
117+
qWarning() << "AddressTablePriv::updateEntry : Warning: Got CT_NEW, but entry is already in model";
118118
break;
119119
}
120120
parent->beginInsertRows(QModelIndex(), lowerIndex, lowerIndex);
@@ -124,7 +124,7 @@ class AddressTablePriv
124124
case CT_UPDATED:
125125
if(!inModel)
126126
{
127-
qDebug() << "AddressTablePriv::updateEntry : Warning: Got CT_UPDATED, but entry is not in model";
127+
qWarning() << "AddressTablePriv::updateEntry : Warning: Got CT_UPDATED, but entry is not in model";
128128
break;
129129
}
130130
lower->type = newEntryType;
@@ -134,7 +134,7 @@ class AddressTablePriv
134134
case CT_DELETED:
135135
if(!inModel)
136136
{
137-
qDebug() << "AddressTablePriv::updateEntry : Warning: Got CT_DELETED, but entry is not in model";
137+
qWarning() << "AddressTablePriv::updateEntry : Warning: Got CT_DELETED, but entry is not in model";
138138
break;
139139
}
140140
parent->beginRemoveRows(QModelIndex(), lowerIndex, upperIndex-1);

src/qt/paymentrequestplus.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ bool PaymentRequestPlus::parse(const QByteArray& data)
2929
{
3030
bool parseOK = paymentRequest.ParseFromArray(data.data(), data.size());
3131
if (!parseOK) {
32-
qDebug() << "PaymentRequestPlus::parse : Error parsing payment request";
32+
qWarning() << "PaymentRequestPlus::parse : Error parsing payment request";
3333
return false;
3434
}
3535
if (paymentRequest.payment_details_version() > 1) {
36-
qDebug() << "PaymentRequestPlus::parse : Received up-version payment details, version=" << paymentRequest.payment_details_version();
36+
qWarning() << "PaymentRequestPlus::parse : Received up-version payment details, version=" << paymentRequest.payment_details_version();
3737
return false;
3838
}
3939

4040
parseOK = details.ParseFromString(paymentRequest.serialized_payment_details());
4141
if (!parseOK)
4242
{
43-
qDebug() << "PaymentRequestPlus::parse : Error parsing payment details";
43+
qWarning() << "PaymentRequestPlus::parse : Error parsing payment details";
4444
paymentRequest.Clear();
4545
return false;
4646
}
@@ -80,17 +80,17 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
8080
digestAlgorithm = EVP_sha1();
8181
}
8282
else if (paymentRequest.pki_type() == "none") {
83-
qDebug() << "PaymentRequestPlus::getMerchant : Payment request: pki_type == none";
83+
qWarning() << "PaymentRequestPlus::getMerchant : Payment request: pki_type == none";
8484
return false;
8585
}
8686
else {
87-
qDebug() << "PaymentRequestPlus::getMerchant : Payment request: unknown pki_type " << QString::fromStdString(paymentRequest.pki_type());
87+
qWarning() << "PaymentRequestPlus::getMerchant : Payment request: unknown pki_type " << QString::fromStdString(paymentRequest.pki_type());
8888
return false;
8989
}
9090

9191
payments::X509Certificates certChain;
9292
if (!certChain.ParseFromString(paymentRequest.pki_data())) {
93-
qDebug() << "PaymentRequestPlus::getMerchant : Payment request: error parsing pki_data";
93+
qWarning() << "PaymentRequestPlus::getMerchant : Payment request: error parsing pki_data";
9494
return false;
9595
}
9696

@@ -100,12 +100,12 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
100100
QByteArray certData(certChain.certificate(i).data(), certChain.certificate(i).size());
101101
QSslCertificate qCert(certData, QSsl::Der);
102102
if (currentTime < qCert.effectiveDate() || currentTime > qCert.expiryDate()) {
103-
qDebug() << "PaymentRequestPlus::getMerchant : Payment request: certificate expired or not yet active: " << qCert;
103+
qWarning() << "PaymentRequestPlus::getMerchant : Payment request: certificate expired or not yet active: " << qCert;
104104
return false;
105105
}
106106
#if QT_VERSION >= 0x050000
107107
if (qCert.isBlacklisted()) {
108-
qDebug() << "PaymentRequestPlus::getMerchant : Payment request: certificate blacklisted: " << qCert;
108+
qWarning() << "PaymentRequestPlus::getMerchant : Payment request: certificate blacklisted: " << qCert;
109109
return false;
110110
}
111111
#endif
@@ -115,7 +115,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
115115
certs.push_back(cert);
116116
}
117117
if (certs.empty()) {
118-
qDebug() << "PaymentRequestPlus::getMerchant : Payment request: empty certificate chain";
118+
qWarning() << "PaymentRequestPlus::getMerchant : Payment request: empty certificate chain";
119119
return false;
120120
}
121121

@@ -131,7 +131,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
131131
// load the signing cert into it and verify.
132132
X509_STORE_CTX *store_ctx = X509_STORE_CTX_new();
133133
if (!store_ctx) {
134-
qDebug() << "PaymentRequestPlus::getMerchant : Payment request: error creating X509_STORE_CTX";
134+
qWarning() << "PaymentRequestPlus::getMerchant : Payment request: error creating X509_STORE_CTX";
135135
return false;
136136
}
137137

@@ -183,7 +183,7 @@ bool PaymentRequestPlus::getMerchant(X509_STORE* certStore, QString& merchant) c
183183
catch (SSLVerifyError& err)
184184
{
185185
fResult = false;
186-
qDebug() << "PaymentRequestPlus::getMerchant : SSL error: " << err.what();
186+
qWarning() << "PaymentRequestPlus::getMerchant : SSL error: " << err.what();
187187
}
188188

189189
if (website)

src/qt/paymentserver.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static QList<QString> savedPaymentRequests;
9090

9191
static void ReportInvalidCertificate(const QSslCertificate& cert)
9292
{
93-
qDebug() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName);
93+
qWarning() << "ReportInvalidCertificate : Payment server found an invalid certificate: " << cert.subjectInfo(QSslCertificate::CommonName);
9494
}
9595

9696
//
@@ -161,7 +161,7 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store)
161161
continue;
162162
}
163163
}
164-
qDebug() << "PaymentServer::LoadRootCAs : Loaded " << nRootCerts << " root certificates";
164+
qWarning() << "PaymentServer::LoadRootCAs : Loaded " << nRootCerts << " root certificates";
165165

166166
// Project for another day:
167167
// Fetch certificate revocation lists, and add them to certStore.
@@ -223,7 +223,7 @@ bool PaymentServer::ipcParseCommandLine(int argc, char* argv[])
223223
{
224224
// Printing to debug.log is about the best we can do here, the
225225
// GUI hasn't started yet so we can't pop up a message box.
226-
qDebug() << "PaymentServer::ipcSendCommandLine : Payment request file does not exist: " << arg;
226+
qWarning() << "PaymentServer::ipcSendCommandLine : Payment request file does not exist: " << arg;
227227
}
228228
}
229229
return true;
@@ -403,7 +403,7 @@ void PaymentServer::handleURIOrFile(const QString& s)
403403
}
404404
else
405405
{
406-
qDebug() << "PaymentServer::handleURIOrFile : Invalid URL: " << fetchUrl;
406+
qWarning() << "PaymentServer::handleURIOrFile : Invalid URL: " << fetchUrl;
407407
emit message(tr("URI handling"),
408408
tr("Payment request fetch URL is invalid: %1").arg(fetchUrl.toString()),
409409
CClientUIInterface::ICON_WARNING);
@@ -476,13 +476,13 @@ bool PaymentServer::readPaymentRequest(const QString& filename, PaymentRequestPl
476476
QFile f(filename);
477477
if (!f.open(QIODevice::ReadOnly))
478478
{
479-
qDebug() << "PaymentServer::readPaymentRequest : Failed to open " << filename;
479+
qWarning() << "PaymentServer::readPaymentRequest : Failed to open " << filename;
480480
return false;
481481
}
482482

483483
if (f.size() > MAX_PAYMENT_REQUEST_SIZE)
484484
{
485-
qDebug() << "PaymentServer::readPaymentRequest : " << filename << " too large";
485+
qWarning() << "PaymentServer::readPaymentRequest : " << filename << " too large";
486486
return false;
487487
}
488488

@@ -624,7 +624,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien
624624
else {
625625
// This should never happen, because sending coins should have
626626
// just unlocked the wallet and refilled the keypool.
627-
qDebug() << "PaymentServer::fetchPaymentACK : Error getting refund key, refund_to not set";
627+
qWarning() << "PaymentServer::fetchPaymentACK : Error getting refund key, refund_to not set";
628628
}
629629
}
630630

@@ -636,7 +636,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien
636636
}
637637
else {
638638
// This should never happen, either.
639-
qDebug() << "PaymentServer::fetchPaymentACK : Error serializing payment message";
639+
qWarning() << "PaymentServer::fetchPaymentACK : Error serializing payment message";
640640
}
641641
}
642642

@@ -649,7 +649,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply)
649649
.arg(reply->request().url().toString())
650650
.arg(reply->errorString());
651651

652-
qDebug() << "PaymentServer::netRequestFinished : " << msg;
652+
qWarning() << "PaymentServer::netRequestFinished : " << msg;
653653
emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR);
654654
return;
655655
}
@@ -663,7 +663,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply)
663663
SendCoinsRecipient recipient;
664664
if (!request.parse(data))
665665
{
666-
qDebug() << "PaymentServer::netRequestFinished : Error parsing payment request";
666+
qWarning() << "PaymentServer::netRequestFinished : Error parsing payment request";
667667
emit message(tr("Payment request error"),
668668
tr("Payment request can not be parsed!"),
669669
CClientUIInterface::MSG_ERROR);
@@ -681,7 +681,7 @@ void PaymentServer::netRequestFinished(QNetworkReply* reply)
681681
QString msg = tr("Bad response from server %1")
682682
.arg(reply->request().url().toString());
683683

684-
qDebug() << "PaymentServer::netRequestFinished : " << msg;
684+
qWarning() << "PaymentServer::netRequestFinished : " << msg;
685685
emit message(tr("Payment request error"), msg, CClientUIInterface::MSG_ERROR);
686686
}
687687
else
@@ -697,7 +697,7 @@ void PaymentServer::reportSslErrors(QNetworkReply* reply, const QList<QSslError>
697697

698698
QString errString;
699699
foreach (const QSslError& err, errs) {
700-
qDebug() << "PaymentServer::reportSslErrors : " << err;
700+
qWarning() << "PaymentServer::reportSslErrors : " << err;
701701
errString += err.errorString() + "\n";
702702
}
703703
emit message(tr("Network request error"), errString, CClientUIInterface::MSG_ERROR);

src/qt/transactiontablemodel.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ class TransactionTablePriv
130130
case CT_NEW:
131131
if(inModel)
132132
{
133-
qDebug() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is already in model";
133+
qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is already in model";
134134
break;
135135
}
136136
if(!inWallet)
137137
{
138-
qDebug() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is not in wallet";
138+
qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_NEW, but transaction is not in wallet";
139139
break;
140140
}
141141
if(showTransaction)
@@ -159,7 +159,7 @@ class TransactionTablePriv
159159
case CT_DELETED:
160160
if(!inModel)
161161
{
162-
qDebug() << "TransactionTablePriv::updateWallet : Warning: Got CT_DELETED, but transaction is not in model";
162+
qWarning() << "TransactionTablePriv::updateWallet : Warning: Got CT_DELETED, but transaction is not in model";
163163
break;
164164
}
165165
// Removed -- remove entire transaction from table

src/qt/winshutdownmonitor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ void WinShutdownMonitor::registerShutdownBlockReason(const QString& strReason, c
4545
typedef BOOL (WINAPI *PSHUTDOWNBRCREATE)(HWND, LPCWSTR);
4646
PSHUTDOWNBRCREATE shutdownBRCreate = (PSHUTDOWNBRCREATE)GetProcAddress(GetModuleHandleA("User32.dll"), "ShutdownBlockReasonCreate");
4747
if (shutdownBRCreate == NULL) {
48-
qDebug() << "registerShutdownBlockReason : GetProcAddress for ShutdownBlockReasonCreate failed";
48+
qWarning() << "registerShutdownBlockReason : GetProcAddress for ShutdownBlockReasonCreate failed";
4949
return;
5050
}
5151

5252
if (shutdownBRCreate(mainWinId, strReason.toStdWString().c_str()))
53-
qDebug() << "registerShutdownBlockReason : Successfully registered: " + strReason;
53+
qWarning() << "registerShutdownBlockReason : Successfully registered: " + strReason;
5454
else
55-
qDebug() << "registerShutdownBlockReason : Failed to register: " + strReason;
55+
qWarning() << "registerShutdownBlockReason : Failed to register: " + strReason;
5656
}
5757
#endif

0 commit comments

Comments
 (0)