mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-27 00:53:22 +00:00
Install Qt log handler
This commit is contained in:
parent
7ebebc2bc3
commit
2b5df331bd
@ -282,6 +282,19 @@ void Launcher::init() {
|
||||
|
||||
prepareSettings();
|
||||
|
||||
static QtMessageHandler originalMessageHandler = nullptr;
|
||||
originalMessageHandler = qInstallMessageHandler([](
|
||||
QtMsgType type,
|
||||
const QMessageLogContext &context,
|
||||
const QString &msg) {
|
||||
if (originalMessageHandler) {
|
||||
originalMessageHandler(type, context, msg);
|
||||
}
|
||||
if (Logs::DebugEnabled() || !Logs::started()) {
|
||||
LOG((msg));
|
||||
}
|
||||
});
|
||||
|
||||
QApplication::setApplicationName(qsl("TelegramDesktop"));
|
||||
|
||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user