Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MU3] Backend log fix #11175

Merged
merged 1 commit into from
Apr 13, 2022
Merged

[MU3] Backend log fix #11175

merged 1 commit into from
Apr 13, 2022

Conversation

Eism
Copy link
Contributor

@Eism Eism commented Apr 13, 2022

Disabled logging for backend

@Eism Eism merged commit 94c5389 into musescore:3.6.2_backend Apr 13, 2022
@Eism Eism deleted the backend_log_fix branch April 13, 2022 09:22
@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Apr 13, 2022

Wouldn't using a non-Debug build have disabled that logging automagically?

Also how is disabling some code that is for Windows only going to help on the backend, which is Linux? I'm confused...

@Eism
Copy link
Contributor Author

Eism commented Apr 13, 2022

@Jojo-Schmitz

Wouldn't using a non-Debug build have disabled that logging automagically?

qWarning in qt library are printed to stdout. Extra logs interfere with the parsing of command results. We can disable logging only in this way.

Also how is disabling some code that is for Windows only going to help on the backend, which is Linux? I'm confused...

That is the problem.
Previously, the handler worked only for Windows, for Linux (backend) the logs were printed as they are to the console. Log output is now disabled for all platforms on the backend

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Apr 13, 2022

I see, thanks for explaining.
So we might have done this instead:

static void mscoreMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg)
{
#if ! defined(QT_DEBUG)
      Q_UNUSED(type);
      Q UNUSED(context);
      Q_UNUSED(msg)
#else
...
#endif
}

Probably should have done so long ago

Or even

static void mscoreMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString& msg)
{
      if (debugMode) {
...
      }
}

to have them available when using the -d option

BTW: qWarning() and friends do not send to stdout but to stderr, so a mscore ... 2>/dev/null should get rid of it too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants