[][src]Function sentry_slog::exception_from_record

pub fn exception_from_record(
    record: &Record,
    values: &OwnedKVList
) -> Event<'static>

Creates an exception Event from the slog::Record.

The exception will have a stacktrace that corresponds to the location information contained in the slog::Record.

Examples

let args = format_args!("");
let record = slog::record!(slog::Level::Error, "", &args, slog::b!());
let kv = slog::o!().into();
let event = sentry_slog::exception_from_record(&record, &kv);

let frame = &event.exception.as_ref()[0]
    .stacktrace
    .as_ref()
    .unwrap()
    .frames[0];
assert!(frame.lineno.unwrap() > 0);