mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02:00
Install Qt log handler
This commit is contained in:
parent
7ebebc2bc3
commit
2b5df331bd
1 changed files with 13 additions and 0 deletions
|
@ -282,6 +282,19 @@ void Launcher::init() {
|
||||||
|
|
||||||
prepareSettings();
|
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"));
|
QApplication::setApplicationName(qsl("TelegramDesktop"));
|
||||||
|
|
||||||
#if defined Q_OS_UNIX && !defined Q_OS_MAC && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
#if defined Q_OS_UNIX && !defined Q_OS_MAC && QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue