Files
warmbly/tracking/src/observability.rs
T
2026-02-14 05:49:49 +01:00

18 lines
487 B
Rust

use tracing::{error, info};
pub fn init(env: &str) {
if env == "prod" {
info!("Issue reporting initialized (env=prod)");
} else {
info!("Issue reporting initialized (env={env}, local issue logging enabled)");
}
}
pub fn report_issue(context: &str, details: &str) {
error!("[issue-local][tracking] {context}: {details}");
}
pub fn report_error(context: &str, err: &(dyn std::error::Error + Send + Sync)) {
report_issue(context, &err.to_string());
}