@@ -99,29 +99,66 @@ Capturing Messages
99
99
Passing Additional Data
100
100
-----------------------
101
101
102
- ``captureException ``, ``context ``, ``wrap ``, and ``captureMessage ``
103
- functions all allow passing additional data to be tagged onto the error,
104
- such as ``tags `` or ``extra `` for additional context.
102
+ The ``captureMessage ``, ``captureException ``, ``context ``, and ``wrap ``
103
+ functions all allow passing additional data to be tagged onto the error.
105
104
106
- .. code-block :: javascript
105
+ .. describe :: level
107
106
108
- Raven . captureException (e, {tags : { key : " value " }})
107
+ The log level associated with this event. Default: `` error ``
109
108
110
- Raven . captureMessage ( ' Broken! ' , {tags : { key : " value " }})
109
+ .. code-block :: javascript
111
110
112
- Raven .context ({tags: { key: " value" }}, function (){ ... })
111
+ Raven .captureMessage (' Something happened' , {
112
+ level: ' info' // one of 'info', 'warning', or 'error'
113
+ });
113
114
114
- Raven . wrap ({logger : " my.module " }, function (){ ... })
115
+ .. describe :: logger
115
116
116
- Raven . captureException (e, {extra : { foo : " bar " }})
117
+ The name of the logger used to record this event. Default: `` javascript ``
117
118
118
- You can also set context variables globally to be merged in with future
119
- exceptions with ``setExtraContext `` and ``setTagsContext ``.
119
+ .. code-block :: javascript
120
120
121
- .. code-block :: javascript
121
+ Raven .captureException (new Error (' Oops!' ), {
122
+ logger: ' my.module'
123
+ });
124
+
125
+ Note that logger can also be set globally via ``Raven.config ``.
126
+
127
+ .. describe :: tags
128
+
129
+ `Tags <https://www.getsentry.com/docs/tags/ >`__ to assign to the event.
130
+
131
+ .. code-block :: javascript
132
+
133
+ Raven .wrap ({
134
+ tags: {git_commit: ' c0deb10c4' }
135
+ }, function () { /* ... */ });
136
+
137
+ // NOTE: Raven.wrap and Raven.context accept options as first argument
138
+
139
+ You can also set tags globally to be merged in with future exceptions events via ``Raven.config ``, or ``Raven.setTagsContext ``:
140
+
141
+ .. code-block :: javascript
142
+
143
+ Raven .setTagsContext ({ key: " value" });
144
+
145
+ .. describe :: extra
146
+
147
+ Arbitrary data to associate with the event.
148
+
149
+ .. code-block :: javascript
150
+
151
+ Raven .context ({
152
+ extra: {planet: {name: ' Earth' }}}
153
+ }, function () { /* ... */ });
154
+
155
+ // NOTE: Raven.wrap and Raven.context accept options as first argument
156
+
157
+ You can also set extra data globally to be merged in with future events with ``setExtraContext ``:
158
+
159
+ .. code-block :: javascript
122
160
123
- Raven .setExtraContext ({ foo: " bar" })
124
- Raven .setTagsContext ({ key: " value" })
161
+ Raven .setExtraContext ({ foo: " bar" })
125
162
126
163
127
164
Getting Back an Event ID
0 commit comments