mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-29 13:47:47 +00:00
Install Qt log handler
This commit is contained in:
parent
7ebebc2bc3
commit
2b5df331bd
@ -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…
x
Reference in New Issue
Block a user