Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
183 lines
5.6 KiB
Plaintext
183 lines
5.6 KiB
Plaintext
import type { Scope } from '../scope';
|
|
import type { Log } from '../types-hoist/log';
|
|
import type { ParameterizedString } from '../types-hoist/parameterize';
|
|
/**
|
|
* Additional metadata to capture the log with.
|
|
*/
|
|
interface CaptureLogMetadata {
|
|
scope?: Scope;
|
|
}
|
|
/**
|
|
* @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled.
|
|
*
|
|
* @param message - The message to log.
|
|
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { userId: 100, route: '/dashboard' }.
|
|
* @param metadata - additional metadata to capture the log with.
|
|
*
|
|
* @example
|
|
*
|
|
* ```
|
|
* Sentry.logger.trace('User clicked submit button', {
|
|
* buttonId: 'submit-form',
|
|
* formId: 'user-profile',
|
|
* timestamp: Date.now()
|
|
* });
|
|
* ```
|
|
*
|
|
* @example With template strings
|
|
*
|
|
* ```
|
|
* Sentry.logger.trace(Sentry.logger.fmt`User ${user} navigated to ${page}`, {
|
|
* userId: '123',
|
|
* sessionId: 'abc-xyz'
|
|
* });
|
|
* ```
|
|
*/
|
|
export declare function trace(message: ParameterizedString, attributes?: Log['attributes'], { scope }?: CaptureLogMetadata): void;
|
|
/**
|
|
* @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled.
|
|
*
|
|
* @param message - The message to log.
|
|
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { component: 'Header', state: 'loading' }.
|
|
* @param metadata - additional metadata to capture the log with.
|
|
*
|
|
* @example
|
|
*
|
|
* ```
|
|
* Sentry.logger.debug('Component mounted', {
|
|
* component: 'UserProfile',
|
|
* props: { userId: 123 },
|
|
* renderTime: 150
|
|
* });
|
|
* ```
|
|
*
|
|
* @example With template strings
|
|
*
|
|
* ```
|
|
* Sentry.logger.debug(Sentry.logger.fmt`API request to ${endpoint} failed`, {
|
|
* statusCode: 404,
|
|
* requestId: 'req-123',
|
|
* duration: 250
|
|
* });
|
|
* ```
|
|
*/
|
|
export declare function debug(message: ParameterizedString, attributes?: Log['attributes'], { scope }?: CaptureLogMetadata): void;
|
|
/**
|
|
* @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled.
|
|
*
|
|
* @param message - The message to log.
|
|
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { feature: 'checkout', status: 'completed' }.
|
|
* @param metadata - additional metadata to capture the log with.
|
|
*
|
|
* @example
|
|
*
|
|
* ```
|
|
* Sentry.logger.info('User completed checkout', {
|
|
* orderId: 'order-123',
|
|
* amount: 99.99,
|
|
* paymentMethod: 'credit_card'
|
|
* });
|
|
* ```
|
|
*
|
|
* @example With template strings
|
|
*
|
|
* ```
|
|
* Sentry.logger.info(Sentry.logger.fmt`User ${user} updated profile picture`, {
|
|
* userId: 'user-123',
|
|
* imageSize: '2.5MB',
|
|
* timestamp: Date.now()
|
|
* });
|
|
* ```
|
|
*/
|
|
export declare function info(message: ParameterizedString, attributes?: Log['attributes'], { scope }?: CaptureLogMetadata): void;
|
|
/**
|
|
* @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled.
|
|
*
|
|
* @param message - The message to log.
|
|
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { browser: 'Chrome', version: '91.0' }.
|
|
* @param metadata - additional metadata to capture the log with.
|
|
*
|
|
* @example
|
|
*
|
|
* ```
|
|
* Sentry.logger.warn('Browser compatibility issue detected', {
|
|
* browser: 'Safari',
|
|
* version: '14.0',
|
|
* feature: 'WebRTC',
|
|
* fallback: 'enabled'
|
|
* });
|
|
* ```
|
|
*
|
|
* @example With template strings
|
|
*
|
|
* ```
|
|
* Sentry.logger.warn(Sentry.logger.fmt`API endpoint ${endpoint} is deprecated`, {
|
|
* recommendedEndpoint: '/api/v2/users',
|
|
* sunsetDate: '2024-12-31',
|
|
* clientVersion: '1.2.3'
|
|
* });
|
|
* ```
|
|
*/
|
|
export declare function warn(message: ParameterizedString, attributes?: Log['attributes'], { scope }?: CaptureLogMetadata): void;
|
|
/**
|
|
* @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled.
|
|
*
|
|
* @param message - The message to log.
|
|
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { error: 'NetworkError', url: '/api/data' }.
|
|
* @param metadata - additional metadata to capture the log with.
|
|
*
|
|
* @example
|
|
*
|
|
* ```
|
|
* Sentry.logger.error('Failed to load user data', {
|
|
* error: 'NetworkError',
|
|
* url: '/api/users/123',
|
|
* statusCode: 500,
|
|
* retryCount: 3
|
|
* });
|
|
* ```
|
|
*
|
|
* @example With template strings
|
|
*
|
|
* ```
|
|
* Sentry.logger.error(Sentry.logger.fmt`Payment processing failed for order ${orderId}`, {
|
|
* error: 'InsufficientFunds',
|
|
* amount: 100.00,
|
|
* currency: 'USD',
|
|
* userId: 'user-456'
|
|
* });
|
|
* ```
|
|
*/
|
|
export declare function error(message: ParameterizedString, attributes?: Log['attributes'], { scope }?: CaptureLogMetadata): void;
|
|
/**
|
|
* @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled.
|
|
*
|
|
* @param message - The message to log.
|
|
* @param attributes - Arbitrary structured data that stores information about the log - e.g., { appState: 'corrupted', sessionId: 'abc-123' }.
|
|
* @param metadata - additional metadata to capture the log with.
|
|
*
|
|
* @example
|
|
*
|
|
* ```
|
|
* Sentry.logger.fatal('Application state corrupted', {
|
|
* lastKnownState: 'authenticated',
|
|
* sessionId: 'session-123',
|
|
* timestamp: Date.now(),
|
|
* recoveryAttempted: true
|
|
* });
|
|
* ```
|
|
*
|
|
* @example With template strings
|
|
*
|
|
* ```
|
|
* Sentry.logger.fatal(Sentry.logger.fmt`Critical system failure in ${service}`, {
|
|
* service: 'payment-processor',
|
|
* errorCode: 'CRITICAL_FAILURE',
|
|
* affectedUsers: 150,
|
|
* timestamp: Date.now()
|
|
* });
|
|
* ```
|
|
*/
|
|
export declare function fatal(message: ParameterizedString, attributes?: Log['attributes'], { scope }?: CaptureLogMetadata): void;
|
|
export { fmt } from '../utils/parameterize';
|
|
//# sourceMappingURL=public-api.d.ts.map |