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
event_id: String
The event id of this event.
message: String
The message of this event.
timestamp: String
The timestamp of this event.
level: String
The level of warning for this event.
logger: String
The logger for this event.
platform: String
The platform for this event.
sdk: SDK
The SDK of this event.
device: Device
The Device of this event.
culprit: Option<String>
The culprit of this event.
server_name: Option<String>
The server name for this event.
stacktrace: Option<Vec<StackFrame>>
The stacktrace of this event.
release: Option<String>
The release of this event.
The tags of this event.
environment: Option<String>
The environment this event occured in.
modules: HashMap<String, String>
The modules of this event.
extra: HashMap<String, Value>
The extra info for this event.
fingerprint: Vec<String>
The fingerprints of this event.
Methods
impl Event
[src]
fn to_string(&self) -> String
[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]
fn new(
logger: &str,
level: &str,
message: &str,
culprit: Option<&str>,
fingerprint: Option<Vec<String>>,
server_name: Option<&str>,
stacktrace: Option<Vec<StackFrame>>,
release: Option<&str>,
environment: Option<&str>,
device: Option<Device>
) -> Event
[src]
logger: &str,
level: &str,
message: &str,
culprit: Option<&str>,
fingerprint: Option<Vec<String>>,
server_name: Option<&str>,
stacktrace: Option<Vec<StackFrame>>,
release: Option<&str>,
environment: Option<&str>,
device: Option<Device>
) -> Event
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);
fn add_tag(&mut self, key: String, value: String)
[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]
fn clone(&self) -> Event
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more