Fix logger

This commit is contained in:
Florian RICHER 2024-01-06 21:58:24 +01:00
parent 51f34eb290
commit 921658075f
3 changed files with 13 additions and 5 deletions

View file

@ -25,7 +25,7 @@ where
match data {
Ok(data) => datas.push(data),
Err(e) => eprintln!("{:?}", e),
Err(e) => log::warn!("{}", e),
}
}

View file

@ -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! { <App/> }
});
}
@ -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! { <App /> }

View file

@ -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();