mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Log all Qt messages as usual in debug builds.
This commit is contained in:
parent
1209b2692a
commit
52b9a1fceb
1 changed files with 11 additions and 2 deletions
|
@ -424,13 +424,22 @@ void Launcher::initQtMessageLogging() {
|
|||
QtMsgType type,
|
||||
const QMessageLogContext &context,
|
||||
const QString &msg) {
|
||||
const auto InvokeOriginal = [&] {
|
||||
#ifndef _DEBUG
|
||||
if (Logs::DebugEnabled()) {
|
||||
return;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
if (OriginalMessageHandler) {
|
||||
OriginalMessageHandler(type, context, msg);
|
||||
}
|
||||
};
|
||||
InvokeOriginal();
|
||||
if (Logs::DebugEnabled() || !Logs::started()) {
|
||||
if (!Logs::WritingEntry()) {
|
||||
// Sometimes Qt logs something inside our own logging.
|
||||
LOG((msg));
|
||||
}
|
||||
} else if (OriginalMessageHandler) {
|
||||
OriginalMessageHandler(type, context, msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue