aboutsummaryrefslogtreecommitdiffstats
path: root/crates/server
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-07-20 23:00:06 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-07-20 23:00:06 +0200
commit2f671f196e245ac1a791c001286e401a2fab9d3a (patch)
treebe90d8f16d5c8b65c6b77ebe1359d22e9738bbf6 /crates/server
parentchore: Commit (diff)
downloadatuin-2f671f196e245ac1a791c001286e401a2fab9d3a.zip
chore: Commit
Diffstat (limited to '')
-rw-r--r--crates/server/Cargo.toml1
-rw-r--r--crates/server/src/main.rs5
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
}