use crate::output::output::OutputLevel;
use super::output::Output;
pub struct TracingOutput;
impl TracingOutput {
pub fn new(level: &str) -> Self {
let filter = format!("vibe_action={}", level);
let _ = tracing_subscriber::fmt().with_env_filter(filter).try_init();
Self
}
}
impl Output for TracingOutput {
fn level(&self) -> OutputLevel {
OutputLevel::Tracing
}
fn error(&self, msg: &str) {
tracing::error!("{}", msg);
}
fn warning(&self, msg: &str) {
tracing::warn!("{}", msg);
}
fn info(&self, msg: &str) {
tracing::info!("{}", msg);
}
fn success(&self, msg: &str) {
tracing::info!("{}", msg);
}
fn debug(&self, msg: &str) {
tracing::debug!("{}", msg);
}
fn trace(&self, msg: &str) {
tracing::trace!("{}", msg);
}
fn progress(&self, _msg: &str) {}
}