diff options
Diffstat (limited to 'crates/server')
| -rw-r--r-- | crates/server/Cargo.toml | 1 | ||||
| -rw-r--r-- | crates/server/src/main.rs | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/crates/server/Cargo.toml b/crates/server/Cargo.toml index 0afd678b..7343c0fc 100644 --- a/crates/server/Cargo.toml +++ b/crates/server/Cargo.toml @@ -12,6 +12,7 @@ homepage = { workspace = true } repository = { workspace = true } [dependencies] +tracing-subscriber = { version = "0.3", features = ["ansi", "fmt", "registry", "env-filter", "json"] } axum = "0.8" config = { version = "0.15.8", default-features = false, features = ["toml"] } clap = { workspace = true } diff --git a/crates/server/src/main.rs b/crates/server/src/main.rs index fb587754..56c44d2d 100644 --- a/crates/server/src/main.rs +++ b/crates/server/src/main.rs @@ -7,6 +7,7 @@ use database::db::ServerPostgres; use eyre::{Context, Result, eyre}; use tokio::net::TcpListener; use tokio::signal; +use tracing_subscriber::util::SubscriberInitExt; use crate::database::DbType; use crate::settings::Settings; @@ -69,6 +70,10 @@ impl Cmd { #[tokio::main] async fn main() -> Result<()> { + if let Err(e) = tracing_subscriber::registry().try_init() { + eprintln!("failed to initialize logging: {e}"); + } + Cmd::parse().run().await } |
