Skip to content

Commit

Permalink
kble: introduce tracing-subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
kobkaz committed Apr 22, 2024
1 parent ee0e364 commit 2727396
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions kble/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ clap.workspace = true
serde.workspace = true
serde_yaml = "0.9"
serde_with = "3.6"
tracing-subscriber.workspace = true
tracing.workspace = true
notalawyer.workspace = true
notalawyer-clap.workspace = true
10 changes: 10 additions & 0 deletions kble/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::path::PathBuf;
use anyhow::{Context, Result};
use clap::Parser;
use notalawyer_clap::*;
use tracing_subscriber::{prelude::*, EnvFilter};

mod app;
mod plug;
Expand Down Expand Up @@ -33,6 +34,15 @@ impl Args {

#[tokio::main]
async fn main() -> Result<()> {
tracing_subscriber::registry()
.with(
tracing_subscriber::fmt::layer()
.with_ansi(false)
.with_writer(std::io::stderr),
)
.with(EnvFilter::from_default_env())
.init();

let args = Args::parse_with_license_notice(include_notice!());
let config = args.load_spaghetti_config()?;
app::run(&config).await?;
Expand Down

0 comments on commit 2727396

Please sign in to comment.