Use ISO format for timestamps and put it in square brackets when displaying errors

This commit is contained in:
Martchus 2021-10-07 18:18:08 +02:00
parent 8f59dc12d3
commit af24ead784
1 changed files with 4 additions and 4 deletions

View File

@ -83,13 +83,13 @@ void InternalErrorsDialog::addError(InternalError &&newError)
void InternalErrorsDialog::internalAddError(const InternalError &error)
{
const QString url = error.url.toString();
browser()->append(
QString::fromUtf8(error.when.toString(DateTimeOutputFormat::DateAndTime, true).data()) % QChar(':') % QChar(' ') % error.message);
auto *const b = browser();
b->append(QChar('[') % QString::fromUtf8(error.when.toString(DateTimeOutputFormat::Iso, true).data()) % QChar(']') % QChar(' ') % error.message);
if (!url.isEmpty()) {
browser()->append(m_request % QChar(' ') % url);
b->append(m_request % QChar(' ') % url);
}
if (!error.response.isEmpty()) {
browser()->append(m_response % QChar('\n') % QString::fromLocal8Bit(error.response));
b->append(m_response % QChar('\n') % QString::fromLocal8Bit(error.response));
}
// also log errors to console