
This is a relic from the early development days in this repo. When I first started this repo, it was a clean-slate playground to test ideas for solving the road blocks I hit with my previous attempt at an org-mode parser. To keep things simple, I originally only had a very basic set of syntax rules that only vaguely looked similar to org-mode. Once I had things figured out, I kept developing in this repo, morphing it into a full org-mode parser. A couple of references to those early days still remained, and this patch should get rid of the last of them.
35 lines
1.1 KiB
Rust
35 lines
1.1 KiB
Rust
use tracing_subscriber::layer::SubscriberExt;
|
|
use tracing_subscriber::util::SubscriberInitExt;
|
|
// use tracing_subscriber::EnvFilter;
|
|
|
|
pub fn init_telemetry() -> Result<(), Box<dyn std::error::Error>> {
|
|
// let env_filter = EnvFilter::try_from_default_env().unwrap_or(EnvFilter::new("warn"));
|
|
|
|
// let stdout = tracing_subscriber::fmt::Layer::new()
|
|
// .pretty()
|
|
// .with_file(true)
|
|
// .with_line_number(true)
|
|
// .with_thread_ids(false)
|
|
// .with_target(false);
|
|
|
|
opentelemetry::global::set_text_map_propagator(opentelemetry_jaeger::Propagator::new());
|
|
let tracer = opentelemetry_jaeger::new_pipeline()
|
|
.with_service_name("organic")
|
|
.install_simple()?;
|
|
|
|
let opentelemetry = tracing_opentelemetry::layer().with_tracer(tracer);
|
|
|
|
tracing_subscriber::registry()
|
|
// .with(env_filter)
|
|
.with(opentelemetry)
|
|
// .with(stdout)
|
|
.try_init()?;
|
|
|
|
Ok(())
|
|
}
|
|
|
|
pub fn shutdown_telemetry() -> Result<(), Box<dyn std::error::Error>> {
|
|
opentelemetry::global::shutdown_tracer_provider();
|
|
Ok(())
|
|
}
|