mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 18:11:33 +08:00
trim newline chars instead of remove 2 chars
This commit is contained in:
parent
c07b3aeef9
commit
362fdc6ceb
@ -41,7 +41,7 @@ protected:
|
|||||||
memory_buf_t formatted;
|
memory_buf_t formatted;
|
||||||
base_sink<Mutex>::formatter_->format(msg, formatted);
|
base_sink<Mutex>::formatter_->format(msg, formatted);
|
||||||
string_view_t str = string_view_t(formatted.data(), formatted.size());
|
string_view_t str = string_view_t(formatted.data(), formatted.size());
|
||||||
QMetaObject::invokeMethod(qtextedit,"append", Qt::AutoConnection, Q_ARG(QString, QString::fromUtf8(str.data(), static_cast<int>(str.size() - 2))));
|
QMetaObject::invokeMethod(qtextedit,"append", Qt::AutoConnection, Q_ARG(QString, QString::fromUtf8(str.data(), static_cast<int>(str.size())).trimmed()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void flush_() override {}
|
void flush_() override {}
|
||||||
@ -73,7 +73,7 @@ protected:
|
|||||||
memory_buf_t formatted;
|
memory_buf_t formatted;
|
||||||
base_sink<Mutex>::formatter_->format(msg, formatted);
|
base_sink<Mutex>::formatter_->format(msg, formatted);
|
||||||
string_view_t str = string_view_t(formatted.data(), formatted.size());
|
string_view_t str = string_view_t(formatted.data(), formatted.size());
|
||||||
QMetaObject::invokeMethod(qplaintextedit, "appendPlainText", Qt::AutoConnection, Q_ARG(QString, QString::fromUtf8(str.data(), static_cast<int>(str.size() - 2))));
|
QMetaObject::invokeMethod(qplaintextedit, "appendPlainText", Qt::AutoConnection, Q_ARG(QString, QString::fromUtf8(str.data(), static_cast<int>(str.size())).trimmed()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void flush_() override {}
|
void flush_() override {}
|
||||||
|
Loading…
Reference in New Issue
Block a user