All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.build.esm.integrations.debug.js.map Maven / Gradle / Ivy

There is a newer version: 8.39.0
Show newest version
{"version":3,"file":"debug.js","sources":["../../../src/integrations/debug.ts"],"sourcesContent":["import type { Event, EventHint, IntegrationFn } from '@sentry/types';\nimport { consoleSandbox } from '@sentry/utils';\nimport { defineIntegration } from '../integration';\n\nconst INTEGRATION_NAME = 'Debug';\n\ninterface DebugOptions {\n  /** Controls whether console output created by this integration should be stringified. Default: `false` */\n  stringify?: boolean;\n  /** Controls whether a debugger should be launched before an event is sent. Default: `false` */\n  debugger?: boolean;\n}\n\n/**\n * Integration to debug sent Sentry events.\n * This integration should not be used in production.\n */\nconst _debugIntegration = ((options: DebugOptions = {}) => {\n  const _options = {\n    debugger: false,\n    stringify: false,\n    ...options,\n  };\n\n  return {\n    name: INTEGRATION_NAME,\n    setup(client) {\n      client.on('beforeSendEvent', (event: Event, hint?: EventHint) => {\n        if (_options.debugger) {\n          // eslint-disable-next-line no-debugger\n          debugger;\n        }\n\n        /* eslint-disable no-console */\n        consoleSandbox(() => {\n          if (_options.stringify) {\n            console.log(JSON.stringify(event, null, 2));\n            if (hint && Object.keys(hint).length) {\n              console.log(JSON.stringify(hint, null, 2));\n            }\n          } else {\n            console.log(event);\n            if (hint && Object.keys(hint).length) {\n              console.log(hint);\n            }\n          }\n        });\n        /* eslint-enable no-console */\n      });\n    },\n  };\n}) satisfies IntegrationFn;\n\nexport const debugIntegration = defineIntegration(_debugIntegration);\n"],"names":[],"mappings":";;;AAIA,MAAM,gBAAA,GAAmB,OAAO,CAAA;;AAShC;AACA;AACA;AACA;AACA,MAAM,iBAAA,IAAqB,CAAC,OAAO,GAAiB,EAAE,KAAK;AAC3D,EAAE,MAAM,WAAW;AACnB,IAAI,QAAQ,EAAE,KAAK;AACnB,IAAI,SAAS,EAAE,KAAK;AACpB,IAAI,GAAG,OAAO;AACd,GAAG,CAAA;AACH;AACA,EAAE,OAAO;AACT,IAAI,IA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