about summary refs log tree commit diff
path: root/kittybox-rs
diff options
context:
space:
mode:
Diffstat (limited to 'kittybox-rs')
-rw-r--r--kittybox-rs/Cargo.lock1
-rw-r--r--kittybox-rs/Cargo.toml1
-rw-r--r--kittybox-rs/src/main.rs10
3 files changed, 11 insertions, 1 deletions
diff --git a/kittybox-rs/Cargo.lock b/kittybox-rs/Cargo.lock
index 1934da0..36a785a 100644
--- a/kittybox-rs/Cargo.lock
+++ b/kittybox-rs/Cargo.lock
@@ -1498,6 +1498,7 @@ dependencies = [
  "tower",
  "tower-http",
  "tracing",
+ "tracing-log",
  "tracing-subscriber",
  "tracing-test",
  "tracing-tree",
diff --git a/kittybox-rs/Cargo.toml b/kittybox-rs/Cargo.toml
index c5aedf1..4c7670d 100644
--- a/kittybox-rs/Cargo.toml
+++ b/kittybox-rs/Cargo.toml
@@ -83,6 +83,7 @@ relative-path = "^1.5.0"     # Portable relative paths for Rust
 sha2 = "^0.9.8"              # SHA-2 series of algorithms for Rust
 tracing = { version = "0.1.34", features = [] }
 tracing-tree = "0.2.1"
+tracing-log = "0.1.3"
 tracing-subscriber = { version = "0.3.11", features = ["env-filter", "json"] }
 tower-http = { version = "0.3.3", features = ["trace", "cors", "catch-panic"] }
 tower = { version = "0.4.12", features = ["tracing"] }
diff --git a/kittybox-rs/src/main.rs b/kittybox-rs/src/main.rs
index 3136924..68d3b01 100644
--- a/kittybox-rs/src/main.rs
+++ b/kittybox-rs/src/main.rs
@@ -147,10 +147,18 @@ where
 #[tokio::main]
 async fn main() {
     use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Registry};
+
     Registry::default()
         .with(EnvFilter::from_default_env())
-        .with(tracing_subscriber::fmt::layer().json())
+        //.with(tracing_subscriber::fmt::layer().json())
+        .with(
+            #[cfg(debug_assertions)]
+            tracing_tree::HierarchicalLayer::new(2),
+            #[cfg(not(debug_assertions))]
+            tracing_subscriber::fmt::layer().json()
+        )
         .init();
+    //let _ = tracing_log::LogTracer::init();
 
     info!("Starting the kittybox server...");