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 = {
1919 whitelistUrls : [
2020 / h t t p s ? : \/ \/ g o o g l e \. c o m / ,
2121 'https://www.google.com'
22- ]
22+ ] ,
23+ autoBreadcrumbs : {
24+ xhr : false ,
25+ console : false ,
26+ dom : true ,
27+ location : false
28+ }
2329} ;
2430
2531Raven . config ( 'https://public@sentry.io/1' , options ) . install ( ) ;
@@ -55,7 +61,9 @@ var err:Error = Raven.lastException();
5561Raven . captureMessage ( 'Broken!' ) ;
5662Raven . captureMessage ( 'Broken!' , { tags : { key : "value" } } ) ;
5763+ Raven . captureMessage ( 'Broken!' , { stacktrace : true } ) ;
58- Raven . captureBreadcrumb ( { } ) ;
64+ Raven . captureBreadcrumb ( {
65+ message : "This is a breadcrumb message."
66+ } ) ;
5967
6068Raven . setRelease ( 'abc123' ) ;
6169Raven . setEnvironment ( 'production' ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export = Raven;
88
99interface RavenOptions {
1010 /** The log level associated with this event. Default: error */
11- level ?: string ;
11+ level ?: LogLevel ;
1212
1313 /** The name of the logger used by Sentry. Default: javascript */
1414 logger ?: string ;
@@ -64,6 +64,9 @@ interface RavenOptions {
6464
6565 /** Enables/disables instrumentation of globals. */
6666 instrument ?: boolean | RavenInstrumentationOptions ;
67+
68+ /** Enables/disables automatic collection of breadcrumbs. */
69+ autoBreadcrumbs ?: boolean | AutoBreadcrumbOptions
6770}
6871
6972interface RavenInstrumentationOptions {
@@ -168,7 +171,7 @@ interface RavenStatic {
168171 captureMessage ( msg : string , options ?: RavenOptions ) : RavenStatic ;
169172
170173 /** Log a breadcrumb */
171- captureBreadcrumb ( crumb : Object ) : RavenStatic ;
174+ captureBreadcrumb ( crumb : Breadcrumb ) : RavenStatic ;
172175
173176 /**
174177 * Clear the user context, removing the user data that would be sent to Sentry.
@@ -245,3 +248,22 @@ interface RavenTransportOptions {
245248interface RavenPlugin {
246249 ( raven : RavenStatic , ...args : any [ ] ) : RavenStatic ;
247250}
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