diff --git a/sources/main.cpp b/sources/main.cpp index db3accc86..2086dc440 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -246,6 +246,14 @@ QGuiApplication::setHighDpiScaleFactorRoundingPolicy(QetSettings::hdpiScaleFacto } } + // Install the log-file message handler BEFORE the application starts: + // QETApp's constructor does the whole startup (collections, editor, + // opening the projects given on the command line), so installing the + // handler afterwards - as was done in the startup worker below - meant + // exactly the interesting lines (collection and project load timers) + // went to stderr, which is invisible in a Windows GUI session. + qInstallMessageHandler(myMessageOutput); + SingleApplication app(argc, argv, true); #ifdef Q_OS_MACOS app.setStyle(QStyleFactory::create("Fusion")); @@ -291,8 +299,6 @@ QGuiApplication::setHighDpiScaleFactorRoundingPolicy(QetSettings::hdpiScaleFacto [[maybe_unused]] auto startup_future = QtConcurrent::run([=]() { - // for debugging - qInstallMessageHandler(myMessageOutput); qInfo("Start-up"); // delete old log files of max 7 days old. delete_old_log_files(7);