This commit is contained in:
Daniel Flanagan 2024-05-06 13:05:04 -05:00
parent 240ee00d6b
commit e2bd82d9ac
3 changed files with 20 additions and 16 deletions

View file

@ -6,8 +6,26 @@ use std::{
use tokio::sync::mpsc::channel; use tokio::sync::mpsc::channel;
use notify::{Config, RecommendedWatcher, RecursiveMode, Watcher}; use notify::{Config, RecommendedWatcher, RecursiveMode, Watcher};
mod observe;
mod prelude; mod observe {
use tracing::level_filters::LevelFilter;
use tracing_subscriber::EnvFilter;
pub fn setup_logging() {
color_eyre::install().expect("Failed to install color_eyre");
let filter = EnvFilter::builder()
.with_default_directive(LevelFilter::TRACE.into())
.parse_lossy("info,chatbot=trace");
tracing_subscriber::fmt().with_env_filter(filter).init();
}
}
mod prelude {
#![allow(unused_imports)]
pub use tracing::{debug, error, info, warn};
}
use axum::{serve, Router}; use axum::{serve, Router};
use tower_http::services::ServeDir; use tower_http::services::ServeDir;

View file

@ -1,12 +0,0 @@
use tracing::level_filters::LevelFilter;
use tracing_subscriber::EnvFilter;
pub fn setup_logging() {
color_eyre::install().expect("Failed to install color_eyre");
let filter = EnvFilter::builder()
.with_default_directive(LevelFilter::TRACE.into())
.parse_lossy("info,chatbot=trace");
tracing_subscriber::fmt().with_env_filter(filter).init();
}

View file

@ -1,2 +0,0 @@
#![allow(unused_imports)]
pub use tracing::{debug, error, info, warn};