File tree Expand file tree Collapse file tree 2 files changed +34
-4
lines changed Expand file tree Collapse file tree 2 files changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,13 @@ var options = {
19
19
whitelistUrls : [
20
20
/ h t t p s ? : \/ \/ g o o g l e \. c o m / ,
21
21
'https://www.google.com'
22
- ]
22
+ ] ,
23
+ autoBreadcrumbs : {
24
+ xhr : false ,
25
+ console : false ,
26
+ dom : true ,
27
+ location : false
28
+ }
23
29
} ;
24
30
25
31
Raven . config ( 'https://[email protected] /1' , options ) . install ( ) ;
@@ -55,7 +61,9 @@ var err:Error = Raven.lastException();
55
61
Raven . captureMessage ( 'Broken!' ) ;
56
62
Raven . captureMessage ( 'Broken!' , { tags : { key : "value" } } ) ;
57
63
+ Raven . captureMessage ( 'Broken!' , { stacktrace : true } ) ;
58
- Raven . captureBreadcrumb ( { } ) ;
64
+ Raven . captureBreadcrumb ( {
65
+ message : "This is a breadcrumb message."
66
+ } ) ;
59
67
60
68
Raven . setRelease ( 'abc123' ) ;
61
69
Raven . setEnvironment ( 'production' ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export = Raven;
8
8
9
9
interface RavenOptions {
10
10
/** The log level associated with this event. Default: error */
11
- level ?: string ;
11
+ level ?: LogLevel ;
12
12
13
13
/** The name of the logger used by Sentry. Default: javascript */
14
14
logger ?: string ;
@@ -64,6 +64,9 @@ interface RavenOptions {
64
64
65
65
/** Enables/disables instrumentation of globals. */
66
66
instrument ?: boolean | RavenInstrumentationOptions ;
67
+
68
+ /** Enables/disables automatic collection of breadcrumbs. */
69
+ autoBreadcrumbs ?: boolean | AutoBreadcrumbOptions
67
70
}
68
71
69
72
interface RavenInstrumentationOptions {
@@ -168,7 +171,7 @@ interface RavenStatic {
168
171
captureMessage ( msg : string , options ?: RavenOptions ) : RavenStatic ;
169
172
170
173
/** Log a breadcrumb */
171
- captureBreadcrumb ( crumb : Object ) : RavenStatic ;
174
+ captureBreadcrumb ( crumb : Breadcrumb ) : RavenStatic ;
172
175
173
176
/**
174
177
* Clear the user context, removing the user data that would be sent to Sentry.
@@ -245,3 +248,22 @@ interface RavenTransportOptions {
245
248
interface RavenPlugin {
246
249
( raven : RavenStatic , ...args : any [ ] ) : RavenStatic ;
247
250
}
251
+
252
+ interface Breadcrumb {
253
+ message ?: string ;
254
+ category ?: string ;
255
+ level ?: LogLevel ;
256
+ data ?: any ;
257
+ type ?: BreadcrumbType
258
+ }
259
+
260
+ type BreadcrumbType = "navigation" | "http" ;
261
+
262
+ interface AutoBreadcrumbOptions {
263
+ xhr ?: boolean ;
264
+ console ?: boolean ;
265
+ dom ?: boolean ;
266
+ location ?: boolean ;
267
+ }
268
+
269
+ type LogLevel = "critical" | "error" | "warn" | "info" | "debug" ;
You can’t perform that action at this time.
0 commit comments