-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[ui] Reduce confusion when qml loading fails #1728
[ui] Reduce confusion when qml loading fails #1728
Conversation
@fabiencastan Just a friendly ping :-) |
meshroom/ui/app.py
Outdated
# If MESHROOM_OUTPUT_QML_WARNINGS is not set and an error in qml files happen we're left | ||
# without any output except "QQmlApplicationEngine failed to load component". This is | ||
# extremely hard to debug to someone who does not know about MESHROOM_OUTPUT_QML_WARNINGS | ||
# beforehand because by default Qml will output errors to stdout. | ||
if "QQmlApplicationEngine failed to load component" in message and \ | ||
not cls.outputQmlWarnings: | ||
logging.warning("Failed to load QML component, set MESHROOM_OUTPUT_QML_WARNINGS=1 " | ||
"to debug why") | ||
|
||
# discard blacklisted Qt messages related to QML when 'output qml warnings' is set to false | ||
if not cls.outputQmlWarnings and any(w in message for w in cls.qmlWarningsBlacklist): | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested:
# If MESHROOM_OUTPUT_QML_WARNINGS is not set and an error in qml files happen we're left | |
# without any output except "QQmlApplicationEngine failed to load component". This is | |
# extremely hard to debug to someone who does not know about MESHROOM_OUTPUT_QML_WARNINGS | |
# beforehand because by default Qml will output errors to stdout. | |
if "QQmlApplicationEngine failed to load component" in message and \ | |
not cls.outputQmlWarnings: | |
logging.warning("Failed to load QML component, set MESHROOM_OUTPUT_QML_WARNINGS=1 " | |
"to debug why") | |
# discard blacklisted Qt messages related to QML when 'output qml warnings' is set to false | |
if not cls.outputQmlWarnings and any(w in message for w in cls.qmlWarningsBlacklist): | |
return | |
if not cls.outputQmlWarnings: | |
# If MESHROOM_OUTPUT_QML_WARNINGS is not set and an error in qml files happen we're left | |
# without any output except "QQmlApplicationEngine failed to load component". This is | |
# extremely hard to debug to someone who does not know about MESHROOM_OUTPUT_QML_WARNINGS | |
# beforehand because by default Qml will output errors to stdout. | |
if "QQmlApplicationEngine failed to load component" in message: | |
logging.warning("Set MESHROOM_OUTPUT_QML_WARNINGS=1 to get more detailed error message.") | |
# discard blacklisted Qt messages related to QML when 'output qml warnings' is not enabled | |
elif any(w in message for w in cls.qmlWarningsBlacklist): | |
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@p12tic Could you have a look to do this minor update before merge?
eb3ea46
to
d3e3bfd
Compare
@fabiencastan friendly ping :-) I think this PR is good to go in. |
meshroom/ui/app.py
Outdated
logging.warning("Failed to load QML component, set MESHROOM_OUTPUT_QML_WARNINGS=1 " | ||
"to debug why") | ||
|
||
if any(w in message for w in cls.qmlWarningsBlacklist): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if any(w in message for w in cls.qmlWarningsBlacklist): | |
# discard blacklisted Qt messages related to QML when 'output qml warnings' is not enabled | |
elif any(w in message for w in cls.qmlWarningsBlacklist): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not tested it, but "elif" would make sense, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, this way full original message will be included.
meshroom/ui/app.py
Outdated
logging.warning("Failed to load QML component, set MESHROOM_OUTPUT_QML_WARNINGS=1 " | ||
"to debug why") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logging.warning("Failed to load QML component, set MESHROOM_OUTPUT_QML_WARNINGS=1 " | |
"to debug why") | |
logging.warning("Set MESHROOM_OUTPUT_QML_WARNINGS=1 to get a detailed error message.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed. Sorry for not noticing these changes in your original suggestion. I should just have applied it instead of rewriting manually.
d3e3bfd
to
0170d01
Compare
Currently we disable all logging out of qml by default. This is problematic in case qml loading fails for any reason (e.g. missing dependencies) as the user will be presented with a message that is not actionable: "QQmlApplicationEngine failed to load component". There is no way to understand what's happening unless the user knows about MESHROOM_OUTPUT_QML_WARNINGS. This is improved by checking for presence of "QQmlApplicationEngine failed to load component" and warning if qml logging is disabled in that case.
0170d01
to
9365a37
Compare
Currently we disable all logging out of qml by default. This is problematic in case qml loading fails for any reason (e.g. missing dependencies) as the user will be presented with a message that is not actionable: "QQmlApplicationEngine failed to load component". There is no way to understand what's happening unless the user knows about MESHROOM_OUTPUT_QML_WARNINGS.
This is improved by checking for presence of "QQmlApplicationEngine failed to load component" and warning if qml logging is disabled in that case.
There has been many issues with this log message and no further logs in the bug tracker, so I'm not the only one who hit this issue. Hopefully this improves debugging experience for everyone.