Initialize the `tracing` logging setup. # Errors - [`InitTracingError`], if initializing the [`tracing_subscriber::Registry`] fails.
(
config: TracingConfig,
service_name: &'static str,
)
| 281 | /// |
| 282 | /// - [`InitTracingError`], if initializing the [`tracing_subscriber::Registry`] fails. |
| 283 | pub fn init_tracing( |
| 284 | config: TracingConfig, |
| 285 | service_name: &'static str, |
| 286 | ) -> Result<impl Drop, Report<InitTracingError>> { |
| 287 | TelemetryRegistry::default() |
| 288 | .with_error_layer() |
| 289 | .with_console_logging(config.logging.console) |
| 290 | .with_file_logging(config.logging.file) |
| 291 | .with_sentry(config.sentry) |
| 292 | .with_otlp(config.otlp, service_name) |
| 293 | .init_global() |
| 294 | } |
no test coverage detected