@@ -49,19 +49,36 @@ pub enum Error {
4949///
5050/// #[tokio::main]
5151/// async fn main() -> Result<(), Error> {
52+ /// // This can come from a Clap argument for example. The enabled builder
53+ /// // function below allows enabling/disabling certain subscribers during
54+ /// // runtime.
55+ /// let otlp_log_flag = false;
56+ ///
5257/// // IMPORTANT: Name the guard variable appropriately, do not just use
5358/// // `let _ =`, as that will drop immediately.
5459/// let _tracing_guard = Tracing::builder()
5560/// .service_name("test")
5661/// .with_console_output(
5762/// Settings::builder()
58- /// .environment_variable("TEST_CONSOLE")
59- /// .default_level(LevelFilter::INFO)
63+ /// .with_environment_variable("TEST_CONSOLE")
64+ /// .with_default_level(LevelFilter::INFO)
65+ /// .enabled(true)
66+ /// .build()
67+ /// )
68+ /// .with_otlp_log_exporter(
69+ /// Settings::builder()
70+ /// .with_environment_variable("TEST_OTLP_LOG")
71+ /// .with_default_level(LevelFilter::DEBUG)
72+ /// .enabled(otlp_log_flag)
73+ /// .build()
74+ /// )
75+ /// .with_otlp_trace_exporter(
76+ /// Settings::builder()
77+ /// .with_environment_variable("TEST_OTLP_TRACE")
78+ /// .with_default_level(LevelFilter::TRACE)
6079/// .enabled(true)
6180/// .build()
6281/// )
63- /// .with_otlp_log_exporter(("TEST_OTLP_LOG", LevelFilter::DEBUG).into())
64- /// .with_otlp_trace_exporter(("TEST_OTLP_TRACE", LevelFilter::TRACE).into())
6582/// .build()
6683/// .init()?;
6784///
0 commit comments