UNPKG

@koempf/shopgate-utility

Version:

Shopgate WebCheckout utility for Kömpf

27 lines (21 loc) 533 B
'use strict' const Sentry = require('@sentry/node') class SentryLogger { constructor (moduleName) { this.moduleName = moduleName } error (error, message, sentryDsn) { Sentry.init({ dsn: sentryDsn, environment: 'production', tracesSampleRate: 1, integrations: [ Sentry.captureConsoleIntegration(), Sentry.httpIntegration(), Sentry.requestDataIntegration() ] }) console.error(`[${this.moduleName}] ${error}`, message) } } module.exports = SentryLogger