Skip to content

Commit

Permalink
fix: init logger only once, use tracing setup
Browse files Browse the repository at this point in the history
Closes: #849
  • Loading branch information
ctron committed Sep 24, 2024
1 parent ae78b03 commit 258ce7c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion xtask/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ license.workspace = true
anyhow = { workspace = true }
async-trait = { workspace = true }
clap = { workspace = true, features = ["derive", "env"] }
env_logger = { workspace = true }
langchain-rust = { workspace = true, features = ["ollama"] }
log = { workspace = true }
nu-ansi-term = { workspace = true }
Expand Down
3 changes: 0 additions & 3 deletions xtask/src/dataset.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::log::init_log;
use anyhow::anyhow;
use clap::Parser;
use postgresql_commands::{pg_dump::PgDumpBuilder, CommandBuilder};
Expand Down Expand Up @@ -82,8 +81,6 @@ impl GenerateDump {
}

pub async fn run(self) -> anyhow::Result<()> {
init_log()?;

let (db, postgres) = match &self.working_dir {
Some(wd) => db::embedded::create_in(wd.join("db")).await?,
None => db::embedded::create().await?,
Expand Down
3 changes: 2 additions & 1 deletion xtask/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![allow(clippy::unwrap_used)]
#![recursion_limit = "256"]

use crate::log::init_log;
use clap::{Parser, Subcommand};

mod ai;
Expand Down Expand Up @@ -44,6 +45,6 @@ pub enum Command {

#[tokio::main]
async fn main() -> anyhow::Result<()> {
env_logger::init();
init_log()?;
Xtask::parse().run().await
}

0 comments on commit 258ce7c

Please sign in to comment.