Hi, I'm working on an iOS application that uses Rust dylib with tracing-oslog as my subscriber.
When I stop the app and quickly reopen it, it crashes on the line 166 OsLogger::on_event:
if let Some(parent_id) = ctx.current_span().id() {
let span = ctx
.span(parent_id)
.expect("invalid span, this shouldn't happen");
While maybe I did something wrong with tracing Spans, I'd expect any subscriber to be more graceful while handling missing spans.
Because if the span data is missing, the worst case should be incomplete traces instead of the crash of an application.
So while line 166 is at fault here, I'd suggest removing all .expect() and replace them with if let and other expressions.
Happy to make a PR if agreed its a good way forward ;-)
Hi, I'm working on an iOS application that uses Rust dylib with tracing-oslog as my subscriber.
When I stop the app and quickly reopen it, it crashes on the line 166 OsLogger::on_event:
While maybe I did something wrong with tracing Spans, I'd expect any subscriber to be more graceful while handling missing spans.
Because if the span data is missing, the worst case should be incomplete traces instead of the crash of an application.
So while line 166 is at fault here, I'd suggest removing all
.expect()and replace them withif letand other expressions.Happy to make a PR if agreed its a good way forward ;-)