Skip to content

Commit

Permalink
Change into_span! to trace_span! to reduce noise (#2203)
Browse files Browse the repository at this point in the history
* change into_span! to trace_span! to reduce noise #2202

* add to changelog and authors list
  • Loading branch information
NickLarsenNZ committed Jul 8, 2022
1 parent 11175c1 commit 380f1c5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -21,3 +21,4 @@ Laura Gallo
Tim Murison
Manmeet Singh
Simon Fell
Nick Larsen
5 changes: 4 additions & 1 deletion CHANGELOG.md
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
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
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

0 comments on commit 380f1c5

Please sign in to comment.