feat: integrate dioxus-logger inline (#3302)

* feat: integrate dioxus-logger inline

* remove log/simple logger references

* fix: add dioxus-data-id-0 to root elements to not emit errors internally

* drop config.toml and use cargo.toml profiles instead

* make clippy happy with the unit value lint

* feat: better presentation for logging
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2024-12-06 16:27:05 -08:00
1 parent 995a529b2f
commit 7d490dc3bd
36 files changed
+255 -169

No files matched your search

+1 -2
View File
@@ -14,7 +14,6 @@ dioxus-fullstack = { workspace = true }
axum = { workspace = true, optional = true }
tokio = { workspace = true, features = ["full"], optional = true }
tower-http = { workspace = true, features = ["auth"], optional = true }
simple_logger = { version = "4.2.0", optional = true }
async-trait = { version = "0.1.71", optional = true }
sqlx = { version = "0.7.0", features = [
"macros",
@@ -44,5 +43,5 @@ optional = true
[features]
default = []
server = ["axum", "tokio", "dioxus-fullstack/axum", "tower-http", "simple_logger", "async-trait", "sqlx", "axum_session", "axum_session_auth", "http", "tower"]
server = ["axum", "tokio", "dioxus-fullstack/axum", "tower-http", "async-trait", "sqlx", "axum_session", "axum_session_auth", "http", "tower"]
web = ["dioxus-web"]
+3 -1
View File
@@ -15,6 +15,9 @@ use dioxus_fullstack::prelude::*;
use serde::{Deserialize, Serialize};
fn main() {
// Set the logger ahead of time since we don't use `dioxus::launch` on the server
dioxus::logger::initialize_default();
#[cfg(feature = "web")]
// Hydrate the application on the client
dioxus_web::launch::launch_cfg(app, dioxus_web::Config::new().hydrate(true));
@@ -27,7 +30,6 @@ fn main() {
use axum_session::SessionStore;
use axum_session_auth::AuthConfig;
use axum_session_auth::SessionSqlitePool;
simple_logger::SimpleLogger::new().init().unwrap();
tokio::runtime::Runtime::new()
.unwrap()
.block_on(async move {