Merge pull request #334 from naturalethic/convert-all-logs-to-trace

This commit is contained in:
Jon Kelley authored and GitHub committed 2022-03-27 22:15:18 -04:00
commit 70fb493ce8
9 files changed
+19 -20

No files matched your search

+3 -3
View File
@@ -36,7 +36,7 @@ pub fn NonUpdatingEvents(cx: Scope) -> Element {
cx.render(rsx! { cx.render(rsx! {
div { div {
button { button {
onclick: move |_| log::info!("Did not cause any updates!"), onclick: move |_| log::trace!("Did not cause any updates!"),
"Click me to log!" "Click me to log!"
} }
} }
@@ -46,9 +46,9 @@ pub fn NonUpdatingEvents(cx: Scope) -> Element {
pub fn DisablePropagation(cx: Scope) -> Element { pub fn DisablePropagation(cx: Scope) -> Element {
cx.render(rsx! { cx.render(rsx! {
div { div {
onclick: move |_| log::info!("event propagated to the div!") onclick: move |_| log::trace!("event propagated to the div!")
button { button {
onclick: move |evt| log::info!("Button will allow propagation"), onclick: move |evt| log::trace!("Button will allow propagation"),
} }
} }
}) })
+1 -1
View File
@@ -46,7 +46,7 @@ fn BlogList(cx: Scope) -> Element {
fn BlogPost(cx: Scope) -> Element { fn BlogPost(cx: Scope) -> Element {
let id = use_route(&cx).segment("id")?; let id = use_route(&cx).segment("id")?;
log::debug!("rendering blog post {}", id); log::trace!("rendering blog post {}", id);
cx.render(rsx! { div { "{id:?}" } }) cx.render(rsx! { div { "{id:?}" } })
} }
+3 -3
View File
@@ -53,13 +53,13 @@ pub fn Route<'a>(cx: Scope<'a, RouteProps<'a>>) -> Element {
router_root.register_total_route(route_context.total_route, cx.scope_id()); router_root.register_total_route(route_context.total_route, cx.scope_id());
}); });
log::debug!("Checking Route: {:?}", cx.props.to); log::trace!("Checking Route: {:?}", cx.props.to);
if router_root.should_render(cx.scope_id()) { if router_root.should_render(cx.scope_id()) {
log::debug!("Route should render: {:?}", cx.scope_id()); log::trace!("Route should render: {:?}", cx.scope_id());
cx.render(rsx!(&cx.props.children)) cx.render(rsx!(&cx.props.children))
} else { } else {
log::debug!("Route should *not* render: {:?}", cx.scope_id()); log::trace!("Route should *not* render: {:?}", cx.scope_id());
None None
} }
} }
+2 -2
View File
@@ -182,7 +182,7 @@ impl RouterCore {
if let Some(route) = roots.get(&scope) { if let Some(route) = roots.get(&scope) {
let cur = &self.current_location().url; let cur = &self.current_location().url;
log::debug!("Checking if {} matches {}", cur, route); log::trace!("Checking if {} matches {}", cur, route);
if route_matches_path(cur, route, self.cfg.base_url.as_ref()) || route.is_empty() { if route_matches_path(cur, route, self.cfg.base_url.as_ref()) || route.is_empty() {
self.route_found.set(Some(scope)); self.route_found.set(Some(scope));
@@ -236,7 +236,7 @@ fn route_matches_path(cur: &Url, attempt: &str, base_url: Option<&String>) -> bo
let attempt_pieces = clean_path(attempt).split('/').collect::<Vec<_>>(); let attempt_pieces = clean_path(attempt).split('/').collect::<Vec<_>>();
log::debug!("Comparing {:?} to {:?}", cur_pieces, attempt_pieces); log::trace!("Comparing {:?} to {:?}", cur_pieces, attempt_pieces);
if attempt_pieces.len() != cur_pieces.len() { if attempt_pieces.len() != cur_pieces.len() {
return false; return false;
+1 -1
View File
@@ -21,7 +21,7 @@ fn simple_test() {
static APP: Component = |cx| { static APP: Component = |cx| {
cx.render(rsx! { cx.render(rsx! {
Router { Router {
onchange: move |route: RouterService| log::info!("route changed to {:?}", route.current_location()), onchange: move |route: RouterService| log::trace!("route changed to {:?}", route.current_location()),
active_class: "is-active", active_class: "is-active",
Route { to: "/", Home {} } Route { to: "/", Home {} }
Route { to: "blog" Route { to: "blog"
+1 -1
View File
@@ -49,7 +49,7 @@ fn main() {
let _ = dom.rebuild(); let _ = dom.rebuild();
let pre = dioxus_ssr::pre_render_vdom(&dom); let pre = dioxus_ssr::pre_render_vdom(&dom);
log::debug!("{}", pre); log::trace!("{}", pre);
// set the inner content of main to the pre-rendered content // set the inner content of main to the pre-rendered content
window() window()
-1
View File
@@ -244,7 +244,6 @@ fn virtual_event_from_websys_event(
let value: Option<String> = (&element) let value: Option<String> = (&element)
.dyn_ref() .dyn_ref()
.map(|input: &web_sys::HtmlInputElement| { .map(|input: &web_sys::HtmlInputElement| {
log::info!("Input type: {}", input.type_());
match input.type_().as_str() { match input.type_().as_str() {
"checkbox" => { "checkbox" => {
match input.checked() { match input.checked() {
+6 -6
View File
@@ -224,7 +224,7 @@ fn two_fragments_with_differrent_elements_are_differet() {
); );
let (_create, changes) = dom.diff_lazynodes(left, right); let (_create, changes) = dom.diff_lazynodes(left, right);
log::debug!("{:#?}", &changes); log::trace!("{:#?}", &changes);
assert_eq!( assert_eq!(
changes.edits, changes.edits,
[ [
@@ -360,7 +360,7 @@ fn keyed_diffing_out_of_order() {
}); });
let (_, changes) = dom.diff_lazynodes(left, right); let (_, changes) = dom.diff_lazynodes(left, right);
log::debug!("{:?}", &changes); log::trace!("{:?}", &changes);
assert_eq!( assert_eq!(
changes.edits, changes.edits,
[PushRoot { root: 7 }, InsertBefore { root: 5, n: 1 }] [PushRoot { root: 7 }, InsertBefore { root: 5, n: 1 }]
@@ -546,7 +546,7 @@ fn keyed_diffing_additions_and_moves_on_ends() {
}); });
let (_, change) = dom.diff_lazynodes(left, right); let (_, change) = dom.diff_lazynodes(left, right);
log::debug!("{:?}", change); log::trace!("{:?}", change);
assert_eq!( assert_eq!(
change.edits, change.edits,
[ [
@@ -579,7 +579,7 @@ fn keyed_diffing_additions_and_moves_in_middle() {
// LIS: 4, 5, 6 // LIS: 4, 5, 6
let (_, change) = dom.diff_lazynodes(left, right); let (_, change) = dom.diff_lazynodes(left, right);
log::debug!("{:#?}", change); log::trace!("{:#?}", change);
assert_eq!( assert_eq!(
change.edits, change.edits,
[ [
@@ -616,7 +616,7 @@ fn controlled_keyed_diffing_out_of_order() {
// LIS: 5, 6 // LIS: 5, 6
let (_, changes) = dom.diff_lazynodes(left, right); let (_, changes) = dom.diff_lazynodes(left, right);
log::debug!("{:#?}", &changes); log::trace!("{:#?}", &changes);
assert_eq!( assert_eq!(
changes.edits, changes.edits,
[ [
@@ -653,7 +653,7 @@ fn controlled_keyed_diffing_out_of_order_max_test() {
}); });
let (_, changes) = dom.diff_lazynodes(left, right); let (_, changes) = dom.diff_lazynodes(left, right);
log::debug!("{:#?}", &changes); log::trace!("{:#?}", &changes);
assert_eq!( assert_eq!(
changes.edits, changes.edits,
[ [
+2 -2
View File
@@ -31,7 +31,7 @@ fn manual_diffing() {
let edits = dom.rebuild(); let edits = dom.rebuild();
log::debug!("edits: {:?}", edits); log::trace!("edits: {:?}", edits);
} }
#[test] #[test]
@@ -97,7 +97,7 @@ fn components_generate() {
}; };
fn Child(cx: Scope) -> Element { fn Child(cx: Scope) -> Element {
log::debug!("Running child"); log::trace!("Running child");
cx.render(rsx! { cx.render(rsx! {
h1 {} h1 {}
}) })