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

Change into_span! to trace_span! to reduce noise #2203

Merged
merged 2 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ Laura Gallo
Tim Murison
Manmeet Singh
Simon Fell
Nick Larsen
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ You can find its changes [documented below](#070---2021-01-01).
- `AppDelegate::window_added` now receives the new window's `WindowHandle`. ([#2119] by [@zedseven])
- Removed line of code that prevented window miximalization. ([#2113] by [@Pavel-N])
- Dont warn about unhandled `Notification`s which have `known_target` set to false ([#2141] by [@xarvic])
- `ClipBox`, `Flex`, `List` and `Split` only call layout on children which need it ([#2145] by [@xarvic])
- `ClipBox`, `Flex`, `List` and `Split` only call layout on children which need it ([#2145] by [@xarvic])
- `SizedBox` now supports using `Key<f64>` for specifying size ([#2151] by [@GoldsteinE])
- `RadioGroup` widgets are now constructed with new `row()`, `column()`, and `for_axis()` methods ([#2157] by [@twitchyliquid64])
- Replace `info_span!` with `trace_span!` ([#2203] by [@NickLarsenNZ])

### Deprecated

Expand Down Expand Up @@ -556,6 +557,7 @@ Last release without a changelog :(
[@GoldsteinE]: https://github.com/GoldsteinE
[@twitchyliquid64]: https://github.com/twitchyliquid64
[@dristic]: https://github.com/dristic
[@NickLarsenNZ]: https://github.com/NickLarsenNZ

[#599]: https://github.com/linebender/druid/pull/599
[#611]: https://github.com/linebender/druid/pull/611
Expand Down Expand Up @@ -850,6 +852,7 @@ Last release without a changelog :(
[#2158]: https://github.com/linebender/druid/pull/2158
[#2172]: https://github.com/linebender/druid/pull/2172
[#2196]: https://github.com/linebender/druid/pull/2196
[#2203]: https://github.com/linebender/druid/pull/2203

[Unreleased]: https://github.com/linebender/druid/compare/v0.7.0...master
[0.7.0]: https://github.com/linebender/druid/compare/v0.6.0...v0.7.0
Expand Down
6 changes: 3 additions & 3 deletions druid/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//! The fundamental druid types.

use std::collections::VecDeque;
use tracing::{info_span, trace, warn};
use tracing::{trace, trace_span, warn};

use crate::bloom::Bloom;
use crate::command::sys::{CLOSE_WINDOW, SUB_WINDOW_HOST_TO_PARENT, SUB_WINDOW_PARENT_TO_HOST};
Expand Down Expand Up @@ -415,7 +415,7 @@ impl<T, W: Widget<T>> WidgetPod<T, W> {
widget_state: child_state,
};
// We add a span so that inner logs are marked as being in a lifecycle pass
info_span!("lifecycle")
trace_span!("lifecycle")
.in_scope(|| child.lifecycle(&mut child_ctx, &hot_changed_event, data, env));
// if hot changes and we're showing widget ids, always repaint
if env.get(Env::DEBUG_WIDGET_ID) {
Expand Down Expand Up @@ -594,7 +594,7 @@ impl<T: Data, W: Widget<T>> WidgetPod<T, W> {
let size_event = LifeCycle::Size(new_size);

// We add a span so that inner logs are marked as being in a lifecycle pass
let _span = info_span!("lifecycle");
let _span = trace_span!("lifecycle");
let _span = _span.enter();
self.inner.lifecycle(&mut child_ctx, &size_event, data, env);
}
Expand Down
12 changes: 6 additions & 6 deletions druid/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

use std::collections::{HashMap, VecDeque};
use std::mem;
use tracing::{error, info, info_span};
use tracing::{error, info, trace_span};

// Automatically defaults to std::time::Instant on non Wasm platforms
use instant::Instant;
Expand Down Expand Up @@ -285,7 +285,7 @@ impl<T: Data> Window<T> {
};

{
let _span = info_span!("event");
let _span = trace_span!("event");
let _span = _span.enter();
self.root.event(&mut ctx, &event, data, env);
}
Expand Down Expand Up @@ -350,7 +350,7 @@ impl<T: Data> Window<T> {
};

{
let _span = info_span!("lifecycle");
let _span = trace_span!("lifecycle");
let _span = _span.enter();
self.root.lifecycle(&mut ctx, event, data, env);
}
Expand Down Expand Up @@ -379,7 +379,7 @@ impl<T: Data> Window<T> {
};

{
let _span = info_span!("update");
let _span = trace_span!("update");
let _span = _span.enter();
self.root.update(&mut update_ctx, data, env);
}
Expand Down Expand Up @@ -475,7 +475,7 @@ impl<T: Data> Window<T> {
};

let content_size = {
let _span = info_span!("layout");
let _span = trace_span!("layout");
let _span = _span.enter();
self.root.layout(&mut layout_ctx, &bc, data, env)
};
Expand Down Expand Up @@ -534,7 +534,7 @@ impl<T: Data> Window<T> {
};

let root = &mut self.root;
info_span!("paint").in_scope(|| {
trace_span!("paint").in_scope(|| {
ctx.with_child_ctx(invalid.clone(), |ctx| root.paint_raw(ctx, data, env));
});

Expand Down