@sentry/browser 10.12.0 → 10.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/npm/cjs/index.js +3 -2
- package/build/npm/cjs/index.js.map +1 -1
- package/build/npm/cjs/tracing/browserTracingIntegration.js +28 -5
- package/build/npm/cjs/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/cjs/tracing/reportPageLoaded.js +18 -0
- package/build/npm/cjs/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/esm/index.js +2 -3
- package/build/npm/esm/index.js.map +1 -1
- package/build/npm/esm/package.json +1 -1
- package/build/npm/esm/tracing/browserTracingIntegration.js +28 -5
- package/build/npm/esm/tracing/browserTracingIntegration.js.map +1 -1
- package/build/npm/esm/tracing/reportPageLoaded.js +16 -0
- package/build/npm/esm/tracing/reportPageLoaded.js.map +1 -0
- package/build/npm/types/index.bundle.tracing.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.d.ts.map +1 -1
- package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts +1 -0
- package/build/npm/types/index.bundle.tracing.replay.feedback.d.ts.map +1 -1
- package/build/npm/types/index.d.ts +2 -3
- package/build/npm/types/index.d.ts.map +1 -1
- package/build/npm/types/tracing/browserTracingIntegration.d.ts +17 -1
- package/build/npm/types/tracing/browserTracingIntegration.d.ts.map +1 -1
- package/build/npm/types/tracing/reportPageLoaded.d.ts +11 -0
- package/build/npm/types/tracing/reportPageLoaded.d.ts.map +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.d.ts +1 -0
- package/build/npm/types-ts3.8/index.bundle.tracing.replay.feedback.d.ts +1 -0
- package/build/npm/types-ts3.8/index.d.ts +2 -3
- package/build/npm/types-ts3.8/tracing/browserTracingIntegration.d.ts +17 -1
- package/build/npm/types-ts3.8/tracing/reportPageLoaded.d.ts +11 -0
- package/package.json +7 -7
- package/build/npm/cjs/log.js +0 -213
- package/build/npm/cjs/log.js.map +0 -1
- package/build/npm/esm/log.js +0 -206
- package/build/npm/esm/log.js.map +0 -1
- package/build/npm/types/log.d.ts +0 -169
- package/build/npm/types/log.d.ts.map +0 -1
- package/build/npm/types-ts3.8/log.d.ts +0 -169
package/build/npm/cjs/log.js
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
3
|
-
const core = require('@sentry/core');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Capture a log with the given level.
|
|
7
|
-
*
|
|
8
|
-
* @param level - The level of the log.
|
|
9
|
-
* @param message - The message to log.
|
|
10
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100.
|
|
11
|
-
* @param severityNumber - The severity number of the log.
|
|
12
|
-
*/
|
|
13
|
-
function captureLog(
|
|
14
|
-
level,
|
|
15
|
-
message,
|
|
16
|
-
attributes,
|
|
17
|
-
severityNumber,
|
|
18
|
-
) {
|
|
19
|
-
core._INTERNAL_captureLog({ level, message, attributes, severityNumber });
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
|
|
24
|
-
*
|
|
25
|
-
* @param message - The message to log.
|
|
26
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
*
|
|
30
|
-
* ```
|
|
31
|
-
* Sentry.logger.trace('User clicked submit button', {
|
|
32
|
-
* buttonId: 'submit-form',
|
|
33
|
-
* formId: 'user-profile',
|
|
34
|
-
* timestamp: Date.now()
|
|
35
|
-
* });
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* @example With template strings
|
|
39
|
-
*
|
|
40
|
-
* ```
|
|
41
|
-
* Sentry.logger.trace(Sentry.logger.fmt`User ${user} navigated to ${page}`, {
|
|
42
|
-
* userId: '123',
|
|
43
|
-
* sessionId: 'abc-xyz'
|
|
44
|
-
* });
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
function trace(message, attributes) {
|
|
48
|
-
captureLog('trace', message, attributes);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
|
|
53
|
-
*
|
|
54
|
-
* @param message - The message to log.
|
|
55
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
*
|
|
59
|
-
* ```
|
|
60
|
-
* Sentry.logger.debug('Component mounted', {
|
|
61
|
-
* component: 'UserProfile',
|
|
62
|
-
* props: { userId: 123 },
|
|
63
|
-
* renderTime: 150
|
|
64
|
-
* });
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
* @example With template strings
|
|
68
|
-
*
|
|
69
|
-
* ```
|
|
70
|
-
* Sentry.logger.debug(Sentry.logger.fmt`API request to ${endpoint} failed`, {
|
|
71
|
-
* statusCode: 404,
|
|
72
|
-
* requestId: 'req-123',
|
|
73
|
-
* duration: 250
|
|
74
|
-
* });
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
function debug(message, attributes) {
|
|
78
|
-
captureLog('debug', message, attributes);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
|
|
83
|
-
*
|
|
84
|
-
* @param message - The message to log.
|
|
85
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
*
|
|
89
|
-
* ```
|
|
90
|
-
* Sentry.logger.info('User completed checkout', {
|
|
91
|
-
* orderId: 'order-123',
|
|
92
|
-
* amount: 99.99,
|
|
93
|
-
* paymentMethod: 'credit_card'
|
|
94
|
-
* });
|
|
95
|
-
* ```
|
|
96
|
-
*
|
|
97
|
-
* @example With template strings
|
|
98
|
-
*
|
|
99
|
-
* ```
|
|
100
|
-
* Sentry.logger.info(Sentry.logger.fmt`User ${user} updated profile picture`, {
|
|
101
|
-
* userId: 'user-123',
|
|
102
|
-
* imageSize: '2.5MB',
|
|
103
|
-
* timestamp: Date.now()
|
|
104
|
-
* });
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
|
-
function info(message, attributes) {
|
|
108
|
-
captureLog('info', message, attributes);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
|
|
113
|
-
*
|
|
114
|
-
* @param message - The message to log.
|
|
115
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
*
|
|
119
|
-
* ```
|
|
120
|
-
* Sentry.logger.warn('Browser compatibility issue detected', {
|
|
121
|
-
* browser: 'Safari',
|
|
122
|
-
* version: '14.0',
|
|
123
|
-
* feature: 'WebRTC',
|
|
124
|
-
* fallback: 'enabled'
|
|
125
|
-
* });
|
|
126
|
-
* ```
|
|
127
|
-
*
|
|
128
|
-
* @example With template strings
|
|
129
|
-
*
|
|
130
|
-
* ```
|
|
131
|
-
* Sentry.logger.warn(Sentry.logger.fmt`API endpoint ${endpoint} is deprecated`, {
|
|
132
|
-
* recommendedEndpoint: '/api/v2/users',
|
|
133
|
-
* sunsetDate: '2024-12-31',
|
|
134
|
-
* clientVersion: '1.2.3'
|
|
135
|
-
* });
|
|
136
|
-
* ```
|
|
137
|
-
*/
|
|
138
|
-
function warn(message, attributes) {
|
|
139
|
-
captureLog('warn', message, attributes);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
|
|
144
|
-
*
|
|
145
|
-
* @param message - The message to log.
|
|
146
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
|
|
147
|
-
*
|
|
148
|
-
* @example
|
|
149
|
-
*
|
|
150
|
-
* ```
|
|
151
|
-
* Sentry.logger.error('Failed to load user data', {
|
|
152
|
-
* error: 'NetworkError',
|
|
153
|
-
* url: '/api/users/123',
|
|
154
|
-
* statusCode: 500,
|
|
155
|
-
* retryCount: 3
|
|
156
|
-
* });
|
|
157
|
-
* ```
|
|
158
|
-
*
|
|
159
|
-
* @example With template strings
|
|
160
|
-
*
|
|
161
|
-
* ```
|
|
162
|
-
* Sentry.logger.error(Sentry.logger.fmt`Payment processing failed for order ${orderId}`, {
|
|
163
|
-
* error: 'InsufficientFunds',
|
|
164
|
-
* amount: 100.00,
|
|
165
|
-
* currency: 'USD',
|
|
166
|
-
* userId: 'user-456'
|
|
167
|
-
* });
|
|
168
|
-
* ```
|
|
169
|
-
*/
|
|
170
|
-
function error(message, attributes) {
|
|
171
|
-
captureLog('error', message, attributes);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.
|
|
176
|
-
*
|
|
177
|
-
* @param message - The message to log.
|
|
178
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
|
-
*
|
|
182
|
-
* ```
|
|
183
|
-
* Sentry.logger.fatal('Application state corrupted', {
|
|
184
|
-
* lastKnownState: 'authenticated',
|
|
185
|
-
* sessionId: 'session-123',
|
|
186
|
-
* timestamp: Date.now(),
|
|
187
|
-
* recoveryAttempted: true
|
|
188
|
-
* });
|
|
189
|
-
* ```
|
|
190
|
-
*
|
|
191
|
-
* @example With template strings
|
|
192
|
-
*
|
|
193
|
-
* ```
|
|
194
|
-
* Sentry.logger.fatal(Sentry.logger.fmt`Critical system failure in ${service}`, {
|
|
195
|
-
* service: 'payment-processor',
|
|
196
|
-
* errorCode: 'CRITICAL_FAILURE',
|
|
197
|
-
* affectedUsers: 150,
|
|
198
|
-
* timestamp: Date.now()
|
|
199
|
-
* });
|
|
200
|
-
* ```
|
|
201
|
-
*/
|
|
202
|
-
function fatal(message, attributes) {
|
|
203
|
-
captureLog('fatal', message, attributes);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
exports.fmt = core.fmt;
|
|
207
|
-
exports.debug = debug;
|
|
208
|
-
exports.error = error;
|
|
209
|
-
exports.fatal = fatal;
|
|
210
|
-
exports.info = info;
|
|
211
|
-
exports.trace = trace;
|
|
212
|
-
exports.warn = warn;
|
|
213
|
-
//# sourceMappingURL=log.js.map
|
package/build/npm/cjs/log.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sources":["../../../src/log.ts"],"sourcesContent":["import type { Log, LogSeverityLevel, ParameterizedString } from '@sentry/core';\nimport { _INTERNAL_captureLog } from '@sentry/core';\n\n/**\n * Capture a log with the given level.\n *\n * @param level - The level of the log.\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100.\n * @param severityNumber - The severity number of the log.\n */\nfunction captureLog(\n level: LogSeverityLevel,\n message: ParameterizedString,\n attributes?: Log['attributes'],\n severityNumber?: Log['severityNumber'],\n): void {\n _INTERNAL_captureLog({ level, message, attributes, severityNumber });\n}\n\n/**\n * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.trace('User clicked submit button', {\n * buttonId: 'submit-form',\n * formId: 'user-profile',\n * timestamp: Date.now()\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.trace(Sentry.logger.fmt`User ${user} navigated to ${page}`, {\n * userId: '123',\n * sessionId: 'abc-xyz'\n * });\n * ```\n */\nexport function trace(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('trace', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.debug('Component mounted', {\n * component: 'UserProfile',\n * props: { userId: 123 },\n * renderTime: 150\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.debug(Sentry.logger.fmt`API request to ${endpoint} failed`, {\n * statusCode: 404,\n * requestId: 'req-123',\n * duration: 250\n * });\n * ```\n */\nexport function debug(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('debug', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.info('User completed checkout', {\n * orderId: 'order-123',\n * amount: 99.99,\n * paymentMethod: 'credit_card'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.info(Sentry.logger.fmt`User ${user} updated profile picture`, {\n * userId: 'user-123',\n * imageSize: '2.5MB',\n * timestamp: Date.now()\n * });\n * ```\n */\nexport function info(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('info', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.warn('Browser compatibility issue detected', {\n * browser: 'Safari',\n * version: '14.0',\n * feature: 'WebRTC',\n * fallback: 'enabled'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.warn(Sentry.logger.fmt`API endpoint ${endpoint} is deprecated`, {\n * recommendedEndpoint: '/api/v2/users',\n * sunsetDate: '2024-12-31',\n * clientVersion: '1.2.3'\n * });\n * ```\n */\nexport function warn(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('warn', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.error('Failed to load user data', {\n * error: 'NetworkError',\n * url: '/api/users/123',\n * statusCode: 500,\n * retryCount: 3\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.error(Sentry.logger.fmt`Payment processing failed for order ${orderId}`, {\n * error: 'InsufficientFunds',\n * amount: 100.00,\n * currency: 'USD',\n * userId: 'user-456'\n * });\n * ```\n */\nexport function error(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('error', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.fatal('Application state corrupted', {\n * lastKnownState: 'authenticated',\n * sessionId: 'session-123',\n * timestamp: Date.now(),\n * recoveryAttempted: true\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.fatal(Sentry.logger.fmt`Critical system failure in ${service}`, {\n * service: 'payment-processor',\n * errorCode: 'CRITICAL_FAILURE',\n * affectedUsers: 150,\n * timestamp: Date.now()\n * });\n * ```\n */\nexport function fatal(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('fatal', message, attributes);\n}\n\nexport { fmt } from '@sentry/core';\n"],"names":["_INTERNAL_captureLog"],"mappings":";;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU;AACnB,EAAE,KAAK;AACP,EAAE,OAAO;AACT,EAAE,UAAU;AACZ,EAAE,cAAc;AAChB,EAAQ;AACR,EAAEA,yBAAoB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,cAAA,EAAgB,CAAC;AACtE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAAuB,UAAU,EAA4B;AACzF,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAAuB,UAAU,EAA4B;AACzF,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;;;;;;;;;"}
|
package/build/npm/esm/log.js
DELETED
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { _INTERNAL_captureLog } from '@sentry/core';
|
|
2
|
-
export { fmt } from '@sentry/core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Capture a log with the given level.
|
|
6
|
-
*
|
|
7
|
-
* @param level - The level of the log.
|
|
8
|
-
* @param message - The message to log.
|
|
9
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100.
|
|
10
|
-
* @param severityNumber - The severity number of the log.
|
|
11
|
-
*/
|
|
12
|
-
function captureLog(
|
|
13
|
-
level,
|
|
14
|
-
message,
|
|
15
|
-
attributes,
|
|
16
|
-
severityNumber,
|
|
17
|
-
) {
|
|
18
|
-
_INTERNAL_captureLog({ level, message, attributes, severityNumber });
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
|
|
23
|
-
*
|
|
24
|
-
* @param message - The message to log.
|
|
25
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
*
|
|
29
|
-
* ```
|
|
30
|
-
* Sentry.logger.trace('User clicked submit button', {
|
|
31
|
-
* buttonId: 'submit-form',
|
|
32
|
-
* formId: 'user-profile',
|
|
33
|
-
* timestamp: Date.now()
|
|
34
|
-
* });
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @example With template strings
|
|
38
|
-
*
|
|
39
|
-
* ```
|
|
40
|
-
* Sentry.logger.trace(Sentry.logger.fmt`User ${user} navigated to ${page}`, {
|
|
41
|
-
* userId: '123',
|
|
42
|
-
* sessionId: 'abc-xyz'
|
|
43
|
-
* });
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
function trace(message, attributes) {
|
|
47
|
-
captureLog('trace', message, attributes);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
|
|
52
|
-
*
|
|
53
|
-
* @param message - The message to log.
|
|
54
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
*
|
|
58
|
-
* ```
|
|
59
|
-
* Sentry.logger.debug('Component mounted', {
|
|
60
|
-
* component: 'UserProfile',
|
|
61
|
-
* props: { userId: 123 },
|
|
62
|
-
* renderTime: 150
|
|
63
|
-
* });
|
|
64
|
-
* ```
|
|
65
|
-
*
|
|
66
|
-
* @example With template strings
|
|
67
|
-
*
|
|
68
|
-
* ```
|
|
69
|
-
* Sentry.logger.debug(Sentry.logger.fmt`API request to ${endpoint} failed`, {
|
|
70
|
-
* statusCode: 404,
|
|
71
|
-
* requestId: 'req-123',
|
|
72
|
-
* duration: 250
|
|
73
|
-
* });
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
function debug(message, attributes) {
|
|
77
|
-
captureLog('debug', message, attributes);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
|
|
82
|
-
*
|
|
83
|
-
* @param message - The message to log.
|
|
84
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
*
|
|
88
|
-
* ```
|
|
89
|
-
* Sentry.logger.info('User completed checkout', {
|
|
90
|
-
* orderId: 'order-123',
|
|
91
|
-
* amount: 99.99,
|
|
92
|
-
* paymentMethod: 'credit_card'
|
|
93
|
-
* });
|
|
94
|
-
* ```
|
|
95
|
-
*
|
|
96
|
-
* @example With template strings
|
|
97
|
-
*
|
|
98
|
-
* ```
|
|
99
|
-
* Sentry.logger.info(Sentry.logger.fmt`User ${user} updated profile picture`, {
|
|
100
|
-
* userId: 'user-123',
|
|
101
|
-
* imageSize: '2.5MB',
|
|
102
|
-
* timestamp: Date.now()
|
|
103
|
-
* });
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
function info(message, attributes) {
|
|
107
|
-
captureLog('info', message, attributes);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
|
|
112
|
-
*
|
|
113
|
-
* @param message - The message to log.
|
|
114
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
*
|
|
118
|
-
* ```
|
|
119
|
-
* Sentry.logger.warn('Browser compatibility issue detected', {
|
|
120
|
-
* browser: 'Safari',
|
|
121
|
-
* version: '14.0',
|
|
122
|
-
* feature: 'WebRTC',
|
|
123
|
-
* fallback: 'enabled'
|
|
124
|
-
* });
|
|
125
|
-
* ```
|
|
126
|
-
*
|
|
127
|
-
* @example With template strings
|
|
128
|
-
*
|
|
129
|
-
* ```
|
|
130
|
-
* Sentry.logger.warn(Sentry.logger.fmt`API endpoint ${endpoint} is deprecated`, {
|
|
131
|
-
* recommendedEndpoint: '/api/v2/users',
|
|
132
|
-
* sunsetDate: '2024-12-31',
|
|
133
|
-
* clientVersion: '1.2.3'
|
|
134
|
-
* });
|
|
135
|
-
* ```
|
|
136
|
-
*/
|
|
137
|
-
function warn(message, attributes) {
|
|
138
|
-
captureLog('warn', message, attributes);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
|
|
143
|
-
*
|
|
144
|
-
* @param message - The message to log.
|
|
145
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
|
|
146
|
-
*
|
|
147
|
-
* @example
|
|
148
|
-
*
|
|
149
|
-
* ```
|
|
150
|
-
* Sentry.logger.error('Failed to load user data', {
|
|
151
|
-
* error: 'NetworkError',
|
|
152
|
-
* url: '/api/users/123',
|
|
153
|
-
* statusCode: 500,
|
|
154
|
-
* retryCount: 3
|
|
155
|
-
* });
|
|
156
|
-
* ```
|
|
157
|
-
*
|
|
158
|
-
* @example With template strings
|
|
159
|
-
*
|
|
160
|
-
* ```
|
|
161
|
-
* Sentry.logger.error(Sentry.logger.fmt`Payment processing failed for order ${orderId}`, {
|
|
162
|
-
* error: 'InsufficientFunds',
|
|
163
|
-
* amount: 100.00,
|
|
164
|
-
* currency: 'USD',
|
|
165
|
-
* userId: 'user-456'
|
|
166
|
-
* });
|
|
167
|
-
* ```
|
|
168
|
-
*/
|
|
169
|
-
function error(message, attributes) {
|
|
170
|
-
captureLog('error', message, attributes);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.
|
|
175
|
-
*
|
|
176
|
-
* @param message - The message to log.
|
|
177
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.
|
|
178
|
-
*
|
|
179
|
-
* @example
|
|
180
|
-
*
|
|
181
|
-
* ```
|
|
182
|
-
* Sentry.logger.fatal('Application state corrupted', {
|
|
183
|
-
* lastKnownState: 'authenticated',
|
|
184
|
-
* sessionId: 'session-123',
|
|
185
|
-
* timestamp: Date.now(),
|
|
186
|
-
* recoveryAttempted: true
|
|
187
|
-
* });
|
|
188
|
-
* ```
|
|
189
|
-
*
|
|
190
|
-
* @example With template strings
|
|
191
|
-
*
|
|
192
|
-
* ```
|
|
193
|
-
* Sentry.logger.fatal(Sentry.logger.fmt`Critical system failure in ${service}`, {
|
|
194
|
-
* service: 'payment-processor',
|
|
195
|
-
* errorCode: 'CRITICAL_FAILURE',
|
|
196
|
-
* affectedUsers: 150,
|
|
197
|
-
* timestamp: Date.now()
|
|
198
|
-
* });
|
|
199
|
-
* ```
|
|
200
|
-
*/
|
|
201
|
-
function fatal(message, attributes) {
|
|
202
|
-
captureLog('fatal', message, attributes);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
export { debug, error, fatal, info, trace, warn };
|
|
206
|
-
//# sourceMappingURL=log.js.map
|
package/build/npm/esm/log.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sources":["../../../src/log.ts"],"sourcesContent":["import type { Log, LogSeverityLevel, ParameterizedString } from '@sentry/core';\nimport { _INTERNAL_captureLog } from '@sentry/core';\n\n/**\n * Capture a log with the given level.\n *\n * @param level - The level of the log.\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100.\n * @param severityNumber - The severity number of the log.\n */\nfunction captureLog(\n level: LogSeverityLevel,\n message: ParameterizedString,\n attributes?: Log['attributes'],\n severityNumber?: Log['severityNumber'],\n): void {\n _INTERNAL_captureLog({ level, message, attributes, severityNumber });\n}\n\n/**\n * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.trace('User clicked submit button', {\n * buttonId: 'submit-form',\n * formId: 'user-profile',\n * timestamp: Date.now()\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.trace(Sentry.logger.fmt`User ${user} navigated to ${page}`, {\n * userId: '123',\n * sessionId: 'abc-xyz'\n * });\n * ```\n */\nexport function trace(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('trace', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.debug('Component mounted', {\n * component: 'UserProfile',\n * props: { userId: 123 },\n * renderTime: 150\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.debug(Sentry.logger.fmt`API request to ${endpoint} failed`, {\n * statusCode: 404,\n * requestId: 'req-123',\n * duration: 250\n * });\n * ```\n */\nexport function debug(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('debug', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.info('User completed checkout', {\n * orderId: 'order-123',\n * amount: 99.99,\n * paymentMethod: 'credit_card'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.info(Sentry.logger.fmt`User ${user} updated profile picture`, {\n * userId: 'user-123',\n * imageSize: '2.5MB',\n * timestamp: Date.now()\n * });\n * ```\n */\nexport function info(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('info', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.warn('Browser compatibility issue detected', {\n * browser: 'Safari',\n * version: '14.0',\n * feature: 'WebRTC',\n * fallback: 'enabled'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.warn(Sentry.logger.fmt`API endpoint ${endpoint} is deprecated`, {\n * recommendedEndpoint: '/api/v2/users',\n * sunsetDate: '2024-12-31',\n * clientVersion: '1.2.3'\n * });\n * ```\n */\nexport function warn(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('warn', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.error('Failed to load user data', {\n * error: 'NetworkError',\n * url: '/api/users/123',\n * statusCode: 500,\n * retryCount: 3\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.error(Sentry.logger.fmt`Payment processing failed for order ${orderId}`, {\n * error: 'InsufficientFunds',\n * amount: 100.00,\n * currency: 'USD',\n * userId: 'user-456'\n * });\n * ```\n */\nexport function error(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('error', message, attributes);\n}\n\n/**\n * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.\n *\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.\n *\n * @example\n *\n * ```\n * Sentry.logger.fatal('Application state corrupted', {\n * lastKnownState: 'authenticated',\n * sessionId: 'session-123',\n * timestamp: Date.now(),\n * recoveryAttempted: true\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.fatal(Sentry.logger.fmt`Critical system failure in ${service}`, {\n * service: 'payment-processor',\n * errorCode: 'CRITICAL_FAILURE',\n * affectedUsers: 150,\n * timestamp: Date.now()\n * });\n * ```\n */\nexport function fatal(message: ParameterizedString, attributes?: Log['attributes']): void {\n captureLog('fatal', message, attributes);\n}\n\nexport { fmt } from '@sentry/core';\n"],"names":[],"mappings":";;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU;AACnB,EAAE,KAAK;AACP,EAAE,OAAO;AACT,EAAE,UAAU;AACZ,EAAE,cAAc;AAChB,EAAQ;AACR,EAAE,oBAAoB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,cAAA,EAAgB,CAAC;AACtE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAAuB,UAAU,EAA4B;AACzF,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,EAAuB,UAAU,EAA4B;AACzF,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,KAAK,CAAC,OAAO,EAAuB,UAAU,EAA4B;AAC1F,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC;AAC1C;;;;"}
|
package/build/npm/types/log.d.ts
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import type { Log, ParameterizedString } from '@sentry/core';
|
|
2
|
-
/**
|
|
3
|
-
* @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
|
|
4
|
-
*
|
|
5
|
-
* @param message - The message to log.
|
|
6
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
*
|
|
10
|
-
* ```
|
|
11
|
-
* Sentry.logger.trace('User clicked submit button', {
|
|
12
|
-
* buttonId: 'submit-form',
|
|
13
|
-
* formId: 'user-profile',
|
|
14
|
-
* timestamp: Date.now()
|
|
15
|
-
* });
|
|
16
|
-
* ```
|
|
17
|
-
*
|
|
18
|
-
* @example With template strings
|
|
19
|
-
*
|
|
20
|
-
* ```
|
|
21
|
-
* Sentry.logger.trace(Sentry.logger.fmt`User ${user} navigated to ${page}`, {
|
|
22
|
-
* userId: '123',
|
|
23
|
-
* sessionId: 'abc-xyz'
|
|
24
|
-
* });
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export declare function trace(message: ParameterizedString, attributes?: Log['attributes']): void;
|
|
28
|
-
/**
|
|
29
|
-
* @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
|
|
30
|
-
*
|
|
31
|
-
* @param message - The message to log.
|
|
32
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
*
|
|
36
|
-
* ```
|
|
37
|
-
* Sentry.logger.debug('Component mounted', {
|
|
38
|
-
* component: 'UserProfile',
|
|
39
|
-
* props: { userId: 123 },
|
|
40
|
-
* renderTime: 150
|
|
41
|
-
* });
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
* @example With template strings
|
|
45
|
-
*
|
|
46
|
-
* ```
|
|
47
|
-
* Sentry.logger.debug(Sentry.logger.fmt`API request to ${endpoint} failed`, {
|
|
48
|
-
* statusCode: 404,
|
|
49
|
-
* requestId: 'req-123',
|
|
50
|
-
* duration: 250
|
|
51
|
-
* });
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
export declare function debug(message: ParameterizedString, attributes?: Log['attributes']): void;
|
|
55
|
-
/**
|
|
56
|
-
* @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
|
|
57
|
-
*
|
|
58
|
-
* @param message - The message to log.
|
|
59
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
*
|
|
63
|
-
* ```
|
|
64
|
-
* Sentry.logger.info('User completed checkout', {
|
|
65
|
-
* orderId: 'order-123',
|
|
66
|
-
* amount: 99.99,
|
|
67
|
-
* paymentMethod: 'credit_card'
|
|
68
|
-
* });
|
|
69
|
-
* ```
|
|
70
|
-
*
|
|
71
|
-
* @example With template strings
|
|
72
|
-
*
|
|
73
|
-
* ```
|
|
74
|
-
* Sentry.logger.info(Sentry.logger.fmt`User ${user} updated profile picture`, {
|
|
75
|
-
* userId: 'user-123',
|
|
76
|
-
* imageSize: '2.5MB',
|
|
77
|
-
* timestamp: Date.now()
|
|
78
|
-
* });
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
export declare function info(message: ParameterizedString, attributes?: Log['attributes']): void;
|
|
82
|
-
/**
|
|
83
|
-
* @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
|
|
84
|
-
*
|
|
85
|
-
* @param message - The message to log.
|
|
86
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
*
|
|
90
|
-
* ```
|
|
91
|
-
* Sentry.logger.warn('Browser compatibility issue detected', {
|
|
92
|
-
* browser: 'Safari',
|
|
93
|
-
* version: '14.0',
|
|
94
|
-
* feature: 'WebRTC',
|
|
95
|
-
* fallback: 'enabled'
|
|
96
|
-
* });
|
|
97
|
-
* ```
|
|
98
|
-
*
|
|
99
|
-
* @example With template strings
|
|
100
|
-
*
|
|
101
|
-
* ```
|
|
102
|
-
* Sentry.logger.warn(Sentry.logger.fmt`API endpoint ${endpoint} is deprecated`, {
|
|
103
|
-
* recommendedEndpoint: '/api/v2/users',
|
|
104
|
-
* sunsetDate: '2024-12-31',
|
|
105
|
-
* clientVersion: '1.2.3'
|
|
106
|
-
* });
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
export declare function warn(message: ParameterizedString, attributes?: Log['attributes']): void;
|
|
110
|
-
/**
|
|
111
|
-
* @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
|
|
112
|
-
*
|
|
113
|
-
* @param message - The message to log.
|
|
114
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
*
|
|
118
|
-
* ```
|
|
119
|
-
* Sentry.logger.error('Failed to load user data', {
|
|
120
|
-
* error: 'NetworkError',
|
|
121
|
-
* url: '/api/users/123',
|
|
122
|
-
* statusCode: 500,
|
|
123
|
-
* retryCount: 3
|
|
124
|
-
* });
|
|
125
|
-
* ```
|
|
126
|
-
*
|
|
127
|
-
* @example With template strings
|
|
128
|
-
*
|
|
129
|
-
* ```
|
|
130
|
-
* Sentry.logger.error(Sentry.logger.fmt`Payment processing failed for order ${orderId}`, {
|
|
131
|
-
* error: 'InsufficientFunds',
|
|
132
|
-
* amount: 100.00,
|
|
133
|
-
* currency: 'USD',
|
|
134
|
-
* userId: 'user-456'
|
|
135
|
-
* });
|
|
136
|
-
* ```
|
|
137
|
-
*/
|
|
138
|
-
export declare function error(message: ParameterizedString, attributes?: Log['attributes']): void;
|
|
139
|
-
/**
|
|
140
|
-
* @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.
|
|
141
|
-
*
|
|
142
|
-
* @param message - The message to log.
|
|
143
|
-
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
*
|
|
147
|
-
* ```
|
|
148
|
-
* Sentry.logger.fatal('Application state corrupted', {
|
|
149
|
-
* lastKnownState: 'authenticated',
|
|
150
|
-
* sessionId: 'session-123',
|
|
151
|
-
* timestamp: Date.now(),
|
|
152
|
-
* recoveryAttempted: true
|
|
153
|
-
* });
|
|
154
|
-
* ```
|
|
155
|
-
*
|
|
156
|
-
* @example With template strings
|
|
157
|
-
*
|
|
158
|
-
* ```
|
|
159
|
-
* Sentry.logger.fatal(Sentry.logger.fmt`Critical system failure in ${service}`, {
|
|
160
|
-
* service: 'payment-processor',
|
|
161
|
-
* errorCode: 'CRITICAL_FAILURE',
|
|
162
|
-
* affectedUsers: 150,
|
|
163
|
-
* timestamp: Date.now()
|
|
164
|
-
* });
|
|
165
|
-
* ```
|
|
166
|
-
*/
|
|
167
|
-
export declare function fatal(message: ParameterizedString, attributes?: Log['attributes']): void;
|
|
168
|
-
export { fmt } from '@sentry/core';
|
|
169
|
-
//# sourceMappingURL=log.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAoB,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAoB/E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,mBAAmB,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,IAAI,CAExF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,mBAAmB,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,IAAI,CAExF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,mBAAmB,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,IAAI,CAEvF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,mBAAmB,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,IAAI,CAEvF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,mBAAmB,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,IAAI,CAExF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,mBAAmB,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,GAAG,IAAI,CAExF;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC"}
|