From d4a9a0a77d99735b1fc6739a0aec3403ed9b5790 Mon Sep 17 00:00:00 2001 From: sowle Date: Sun, 29 Sep 2019 23:53:03 +0300 Subject: [PATCH] gui: fixed a bug with Qt logs in release --- src/gui/qt-daemon/application/mainwindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/qt-daemon/application/mainwindow.cpp b/src/gui/qt-daemon/application/mainwindow.cpp index b0bb4d85..77dff950 100644 --- a/src/gui/qt-daemon/application/mainwindow.cpp +++ b/src/gui/qt-daemon/application/mainwindow.cpp @@ -623,7 +623,16 @@ void qt_log_message_handler(QtMsgType type, const QMessageLogContext &context, c case QtFatalMsg: msg_type = "FATAL "; break; } - LOG_PRINT("[QT] " << msg_type << local_msg.constData() << " @ " << context.file << ":" << context.line << ", " << (context.function ? context.function : ""), LOG_LEVEL_0); + if (context.file == nullptr && context.function == nullptr) + { + // no debug info + LOG_PRINT("[QT] " << msg_type << local_msg.constData(), LOG_LEVEL_0); + } + else + { + // some debug info + LOG_PRINT("[QT] " << msg_type << local_msg.constData() << " @ " << (context.file ? context.file : "") << ":" << context.line << ", " << (context.function ? context.function : ""), LOG_LEVEL_0); + } } bool MainWindow::init_backend(int argc, char* argv[])