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

Reduce log level of common warnings #1029

Closed
wants to merge 1 commit into from

Conversation

chrisduerr
Copy link
Contributor

Log levels of warning and above should indicate unexpected behavior to the user. If the application is performing as expected, users shouldn't be misguided by log messages that are not relevant to potential issues.

If an issue is encountered because of these warnings without any other relevant details in the log, then the log level can still be increased to get a full debug log.


From my understanding of what @Drakulix said on IRC, these messages are expected and I cannot change the behavior to avoid their emission. As such I'd rather not have them visible on my compositor's default log level.

I've already excluded Smithay's info messages from my default log level since these are very verbose, but I think that should be fine. I'd really like to be able to emit Smithay warnings by default. If this patch isn't appropriate, I think my only alternative would be exclusively logging errors.

Log levels of warning and above should indicate unexpected behavior to
the user. If the application is performing as expected, users shouldn't
be misguided by log messages that are not relevant to potential issues.

If an issue is encountered because of these warnings without any other
relevant details in the log, then the log level can still be increased
to get a full debug log.
@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.10 ⚠️

Comparison is base (fa58fec) 23.83% compared to head (d29cfd7) 23.73%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1029      +/-   ##
==========================================
- Coverage   23.83%   23.73%   -0.10%     
==========================================
  Files         137      137              
  Lines       21873    21986     +113     
==========================================
+ Hits         5213     5219       +6     
- Misses      16660    16767     +107     
Flag Coverage Δ
wlcs-core 20.95% <0.00%> (-0.09%) ⬇️
wlcs-output 8.57% <0.00%> (-0.02%) ⬇️
wlcs-pointer-input 23.09% <0.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
anvil/src/shell/grabs.rs 1.46% <ø> (-0.10%) ⬇️
src/backend/allocator/dmabuf.rs 0.00% <ø> (ø)
src/backend/egl/native.rs 0.00% <ø> (ø)
src/backend/input/tablet.rs 0.00% <ø> (ø)
src/backend/renderer/element/utils/elements.rs 0.00% <ø> (ø)
src/backend/renderer/mod.rs 18.29% <ø> (-0.82%) ⬇️
src/desktop/wayland/window.rs 42.66% <0.00%> (-2.84%) ⬇️
src/utils/clock.rs 41.23% <ø> (+1.23%) ⬆️
src/utils/sealed_file.rs 81.25% <ø> (ø)
src/wayland/keyboard_shortcuts_inhibit/mod.rs 14.60% <ø> (ø)
... and 1 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -570,7 +570,7 @@ impl AtomicDrmSurface {
} else {
if current.mode != pending.mode {
if let Err(err) = self.fd.destroy_property_blob(current.blob.into()) {
warn!("Failed to destory old mode property blob: {}", err);
debug!("Failed to destory old mode property blob: {}", err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well this error only occurs at launch, because the current_mode is not an Option, but initialized with a bogus null-blob (which obviously fails to be destroyed). Any further occurrences would indicate an actual error.

However without making it an Option and littering the code with unwraps, I don't see a good way to mitigate that first log message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be possible to just check for Unknown(0) or to have a flag on current.blob which stores if the blob has been initialized or not?

Attempting this operation when it is know that it will fail seems like it's not ideal anyway, so maybe we can just skip the destruction entirely?

@@ -69,7 +69,7 @@ impl DrmDeviceFd {
// This is only needed on older kernels. Newer kernels grant this permission,
// if no other process is already the *master*. So we skip over this error.
if dev.acquire_master_lock().is_err() {
warn!("Unable to become drm master, assuming unprivileged mode");
debug!("Unable to become drm master, assuming unprivileged mode");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this needs to be a really old kernel version to actually indicate an error. I guess this is fine as a debug statement.

@chrisduerr chrisduerr closed this Sep 19, 2023
@chrisduerr chrisduerr deleted the cleanup_logs branch September 19, 2023 05:51
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