forked from getsentry/sentry-cocoa
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSentryEvent.h
186 lines (151 loc) · 4.82 KB
/
SentryEvent.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#import <Foundation/Foundation.h>
#import "SentryDefines.h"
#import "SentrySerializable.h"
NS_ASSUME_NONNULL_BEGIN
@class SentryThread, SentryException, SentryStacktrace, SentryUser, SentryDebugMeta,
SentryBreadcrumb, SentryId, SentryMessage;
NS_SWIFT_NAME(Event)
@interface SentryEvent : NSObject <SentrySerializable>
/**
* This will be set by the initializer.
*/
@property (nonatomic, strong) SentryId *eventId;
/**
* Message of the event.
*/
@property (nonatomic, strong) SentryMessage *_Nullable message;
/**
* The error of the event. This property adds convenience to access the error directly in
* beforeSend. This property is not serialized. Instead when preparing the event the SentryClient
* puts the error into exceptions.
*/
@property (nonatomic, copy) NSError *_Nullable error;
/**
* NSDate of when the event occurred
*/
@property (nonatomic, strong) NSDate *_Nullable timestamp;
/**
* NSDate of when the event started, mostly useful if event type transaction
*/
@property (nonatomic, strong) NSDate *_Nullable startTimestamp;
/**
* SentryLevel of the event
*/
@property (nonatomic) enum SentryLevel level;
/**
* Platform this will be used for symbolicating on the server should be "cocoa"
*/
@property (nonatomic, copy) NSString *platform;
/**
* Define the logger name
*/
@property (nonatomic, copy) NSString *_Nullable logger;
/**
* Define the server name
*/
@property (nonatomic, copy) NSString *_Nullable serverName;
/**
* This property will be filled before the event is sent.
* @warning This is maintained automatically, and shouldn't normally need to be modified.
*/
@property (nonatomic, copy) NSString *_Nullable releaseName;
/**
* This property will be filled before the event is sent.
* @warning This is maintained automatically, and shouldn't normally need to be modified.
*/
@property (nonatomic, copy) NSString *_Nullable dist;
/**
* The environment used for this event
*/
@property (nonatomic, copy) NSString *_Nullable environment;
/**
* The current transaction (state) on the crash
*/
@property (nonatomic, copy) NSString *_Nullable transaction;
/**
* The type of the event, null, default or transaction
*/
@property (nonatomic, copy) NSString *_Nullable type;
/**
* Arbitrary key:value (string:string ) data that will be shown with the event
*/
@property (nonatomic, strong) NSDictionary<NSString *, NSString *> *_Nullable tags;
/**
* Arbitrary additional information that will be sent with the event
*/
@property (nonatomic, strong) NSDictionary<NSString *, id> *_Nullable extra;
/**
* Information about the SDK. For example:
* @code
* {
* version: "6.0.1",
* name: "sentry.cocoa",
* integrations: [
* "react-native"
* ]
* }
* @endcode
* @warning This is automatically maintained and should not normally need to be modified.
*/
@property (nonatomic, strong) NSDictionary<NSString *, id> *_Nullable sdk;
/**
* Modules of the event
*/
@property (nonatomic, strong) NSDictionary<NSString *, NSString *> *_Nullable modules;
/**
* Set the fingerprint of an event to determine the grouping
*/
@property (nonatomic, strong) NSArray<NSString *> *_Nullable fingerprint;
/**
* Set the SentryUser for the event
*/
@property (nonatomic, strong) SentryUser *_Nullable user;
/**
* This object contains meta information.
* @warning This is maintained automatically, and shouldn't normally need to be modified.
*/
@property (nonatomic, strong)
NSDictionary<NSString *, NSDictionary<NSString *, id> *> *_Nullable context;
/**
* Contains SentryThread if an crash occurred of it's an user reported exception
*/
@property (nonatomic, strong) NSArray<SentryThread *> *_Nullable threads;
/**
* General information about the SentryException, usually there is only one
* exception in the array
*/
@property (nonatomic, strong) NSArray<SentryException *> *_Nullable exceptions;
/**
* Separate SentryStacktrace that can be sent with the event, besides threads
*/
@property (nonatomic, strong) SentryStacktrace *_Nullable stacktrace;
/**
* Containing images loaded during runtime
*/
@property (nonatomic, strong) NSArray<SentryDebugMeta *> *_Nullable debugMeta;
/**
* This contains all breadcrumbs available at the time when the event
* occurred/will be sent
*/
@property (nonatomic, strong) NSArray<SentryBreadcrumb *> *_Nullable breadcrumbs;
/**
* Init an SentryEvent will set all needed fields by default
* @return SentryEvent
*/
- (instancetype)init;
/**
* Init an SentryEvent will set all needed fields by default
* @param level SentryLevel
* @return SentryEvent
*/
- (instancetype)initWithLevel:(enum SentryLevel)level NS_DESIGNATED_INITIALIZER;
/**
* Initializes a SentryEvent with an NSError and sets the level to SentryLevelError.
*
* @param error The error of the event.
*
* @return The initialized SentryEvent.
*/
- (instancetype)initWithError:(NSError *)error;
@end
NS_ASSUME_NONNULL_END