Struct sentry_rs::models::Event [] [src]

pub struct Event {
    pub event_id: String,
    pub message: String,
    pub timestamp: String,
    pub level: String,
    pub logger: String,
    pub platform: String,
    pub sdk: SDK,
    pub device: Device,
    pub culprit: Option<String>,
    pub server_name: Option<String>,
    pub stacktrace: Option<Vec<StackFrame>>,
    pub release: Option<String>,
    pub tags: HashMap<String, String>,
    pub environment: Option<String>,
    pub modules: HashMap<String, String>,
    pub extra: HashMap<String, Value>,
    pub fingerprint: Vec<String>,
}

An Event that gets sent to Sentry. Each attribute is described in detail HERE.

Fields

The event id of this event.

The message of this event.

The timestamp of this event.

The level of warning for this event.

The logger for this event.

The platform for this event.

The SDK of this event.

The Device of this event.

The culprit of this event.

The server name for this event.

The stacktrace of this event.

The release of this event.

The tags of this event.

The environment this event occured in.

The modules of this event.

The extra info for this event.

The fingerprints of this event.

Methods

impl Event
[src]

[src]

Serializes an Event for Sentry. This is implemented in a custom way, because renaming the value of a field to a key/value pair in serde_json was something I couldn't figure out how to do, and would probably be uglier than manually building. Maybe not. Anyway we are manually building the json object.

Examples

use sentry_rs::models::Event;
let event: Event = Event::new("my logger", "INFO", "a message", Some("jerk"),
Some(vec!["fingerprint".to_owned()]), Some("server name"), Some(vec![]),
Some("release"), Some("production"), None);

let as_string: String = event.to_string();
println!("{}", as_string);

impl Event
[src]

[src]

A Wrapper around creating a brand new event. May be a little bit of a perf hinderance, if You have Strings, since this method asks for &str (and then turns them into Strings). But if you want to use static strings, or need to pass in one this can be :totes: helpful.

Examples

use sentry_rs::models::Event;
let event: Event = Event::new("my logger", "PANIC", "my message", None, None, None, None, None, None, None);
use sentry_rs::models::Event;
let event: Event = Event::new("my logger", "INFO", "a message", Some("jerk"),
Some(vec!["fingerprint".to_owned()]), Some("server name"), Some(vec![]),
Some("release"), Some("production"), None);

[src]

Adds a tag to this event. Useful for when you're trying to add a specific piece of context.

Examples

use sentry_rs::models::Event;
let mut event: Event = Event::new("my logger", "PANIC", "my message", None, None, None, None, None, None, None);
event.add_tag("User".to_owned(), "Chris Pratt".to_owned());

Trait Implementations

impl Clone for Event
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Event
[src]

[src]

Formats the value using the given formatter.

impl PartialEq for Event
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.