diff --git a/src/app/utils/data_src.rs b/src/app/utils/data_src.rs index 09fff16..d341f1a 100644 --- a/src/app/utils/data_src.rs +++ b/src/app/utils/data_src.rs @@ -25,7 +25,7 @@ where match data { Ok(data) => datas.push(data), - Err(e) => eprintln!("{:?}", e), + Err(e) => log::warn!("{}", e), } } diff --git a/src/lib.rs b/src/lib.rs index 346a48f..b214cef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,10 +12,10 @@ cfg_if! { _ = console_log::init_with_level(log::Level::Debug); console_error_panic_hook::set_once(); - logging::log!("hydrate mode - hydrating"); - logging::log!("Portfolio version : {}", env!("CARGO_PKG_VERSION")); + log::info!("hydrate mode - hydrating"); + log::info!("Portfolio version : {}", env!("CARGO_PKG_VERSION")); - leptos::mount_to_body(|| { + mount_to_body(|| { view! { } }); } @@ -30,7 +30,8 @@ cfg_if! { _ = console_log::init_with_level(log::Level::Debug); console_error_panic_hook::set_once(); - logging::log!("csr mode - mounting to body"); + log::info!("csr mode - mounting to body"); + log::info!("Portfolio version : {}", env!("CARGO_PKG_VERSION")); mount_to_body(|| { view! { } diff --git a/src/main.rs b/src/main.rs index a918395..fac6503 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,9 +8,16 @@ cfg_if! { use leptos::*; use crate::app::*; use leptos_actix::{generate_route_list, LeptosRoutes}; + use simple_logger::SimpleLogger; #[actix_web::main] async fn main() -> std::io::Result<()> { + // Configure logger + SimpleLogger::new() + .env() + .init() + .unwrap(); + // Setting this to None means we'll be using cargo-leptos and its env vars. let conf = get_configuration(None).await.unwrap();