Merge pull request #40 from DogeDark/logger-update

Update `dioxus-logger`
This commit is contained in:
Jonathan Kelley 2024-07-24 13:53:19 -07:00 committed by GitHub
commit 620487b5d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 13 additions and 13 deletions

View File

@ -16,5 +16,4 @@ dioxus = { version = "0.5", features = ["desktop"] }
# Debug # Debug
tracing = "0.1.40" dioxus-logger = "0.5.1"
dioxus-logger = "0.5.0"

View File

@ -1,7 +1,7 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
use dioxus::prelude::*; use dioxus::prelude::*;
use tracing::Level; use dioxus_logger::tracing::{Level, info};
{% if router %} {% if router %}
#[derive(Clone, Routable, Debug, PartialEq)] #[derive(Clone, Routable, Debug, PartialEq)]
enum Route { enum Route {
@ -15,6 +15,7 @@ enum Route {
fn main() { fn main() {
// Init logger // Init logger
dioxus_logger::init(Level::INFO).expect("failed to init logger"); dioxus_logger::init(Level::INFO).expect("failed to init logger");
info!("starting app");
{% if styling == "Tailwind" %} {% if styling == "Tailwind" %}
let cfg = dioxus::desktop::Config::new().with_custom_head(r#"<link rel="stylesheet" href="tailwind.css">"#.to_string()); let cfg = dioxus::desktop::Config::new().with_custom_head(r#"<link rel="stylesheet" href="tailwind.css">"#.to_string());
LaunchBuilder::desktop().with_cfg(cfg).launch(App); LaunchBuilder::desktop().with_cfg(cfg).launch(App);

View File

@ -15,8 +15,7 @@ dioxus = { version = "0.5", features = ["fullstack"] }
{% endif %} {% endif %}
# Debug # Debug
tracing = "0.1.40" dioxus-logger = "0.5.1"
dioxus-logger = "0.5.0"
[features] [features]
default = [] default = []

View File

@ -1,7 +1,7 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
use dioxus::prelude::*; use dioxus::prelude::*;
use tracing::{Level, info}; use dioxus_logger::tracing::{Level, info};
{% if router %} {% if router %}
#[derive(Clone, Routable, Debug, PartialEq, serde::Serialize, serde::Deserialize)] #[derive(Clone, Routable, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
@ -16,6 +16,7 @@ enum Route {
fn main() { fn main() {
// Init logger // Init logger
dioxus_logger::init(Level::INFO).expect("failed to init logger"); dioxus_logger::init(Level::INFO).expect("failed to init logger");
info!("starting app");
launch(App); launch(App);
} }
@ -53,7 +54,7 @@ fn Home() -> Element {
button { button {
onclick: move |_| async move { onclick: move |_| async move {
if let Ok(data) = get_server_data().await { if let Ok(data) = get_server_data().await {
tracing::info!("Client received: {}", data); info!("Client received: {}", data);
text.set(data.clone()); text.set(data.clone());
post_server_data(data).await.unwrap(); post_server_data(data).await.unwrap();
} }

View File

@ -18,5 +18,4 @@ axum = { version = "0.7.4", features = ["ws"] }
{% endif %} {% endif %}
# Debug # Debug
tracing = "0.1.40" dioxus-logger = "0.5.1"
dioxus-logger = "0.5.0"

View File

@ -1,7 +1,7 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
use dioxus::prelude::*; use dioxus::prelude::*;
use tracing::Level; use dioxus_logger::tracing::{Level, info};
{% if router %} {% if router %}
#[derive(Clone, Routable, Debug, PartialEq)] #[derive(Clone, Routable, Debug, PartialEq)]
enum Route { enum Route {
@ -15,6 +15,7 @@ enum Route {
fn main() { fn main() {
// Init logger // Init logger
dioxus_logger::init(Level::INFO).expect("failed to init logger"); dioxus_logger::init(Level::INFO).expect("failed to init logger");
info!("starting app");
launch(App); launch(App);
} }

View File

@ -16,5 +16,4 @@ dioxus = { version = "0.5", features = ["web"] }
# Debug # Debug
tracing = "0.1.40" dioxus-logger = "0.5.1"
dioxus-logger = "0.5.0"

View File

@ -1,7 +1,7 @@
#![allow(non_snake_case)] #![allow(non_snake_case)]
use dioxus::prelude::*; use dioxus::prelude::*;
use tracing::Level; use dioxus_logger::tracing::{Level, info};
{% if router %} {% if router %}
#[derive(Clone, Routable, Debug, PartialEq)] #[derive(Clone, Routable, Debug, PartialEq)]
enum Route { enum Route {
@ -15,6 +15,7 @@ enum Route {
fn main() { fn main() {
// Init logger // Init logger
dioxus_logger::init(Level::INFO).expect("failed to init logger"); dioxus_logger::init(Level::INFO).expect("failed to init logger");
info!("starting app");
launch(App); launch(App);
} }