about summary refs log tree commit diff
path: root/src/bin/kittybox-mf2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/kittybox-mf2.rs')
-rw-r--r--src/bin/kittybox-mf2.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/bin/kittybox-mf2.rs b/src/bin/kittybox-mf2.rs
index 85ebc6f..0cd89b4 100644
--- a/src/bin/kittybox-mf2.rs
+++ b/src/bin/kittybox-mf2.rs
@@ -26,6 +26,22 @@ enum Error {
 
 #[tokio::main]
 async fn main() -> Result<(), Error> {
+    use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Registry};
+
+    let tracing_registry = Registry::default()
+        .with(EnvFilter::from_default_env())
+        .with(
+            #[cfg(debug_assertions)]
+            tracing_tree::HierarchicalLayer::new(2)
+                .with_bracketed_fields(true)
+                .with_indent_lines(true)
+                .with_verbose_exit(true),
+            #[cfg(not(debug_assertions))]
+            tracing_subscriber::fmt::layer().json()
+                .with_ansi(std::io::IsTerminal::is_terminal(&std::io::stdout().lock()))
+        );
+    tracing_registry.init();
+
     let args = Args::parse();
 
     let http: reqwest::Client = {