diff --git a/Telegram/SourceFiles/core/launcher.cpp b/Telegram/SourceFiles/core/launcher.cpp index 006639ec0f..46066bfff8 100644 --- a/Telegram/SourceFiles/core/launcher.cpp +++ b/Telegram/SourceFiles/core/launcher.cpp @@ -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)