1.0.6 • Published 1 year ago
@pouch/extension-logs v1.0.6
Extension logs and monitoring service
Based on DataDog and required Megatron clientHash as session ID.
Documentation: https://docs.datadoghq.com/logs/error_tracking/browser_and_mobile?tab=browser
Automatically log console errors and unhandled errors on HTML pages after initialisation.
Usage
Install package:
npm install @pouch/extension-logs --save-dev
Import log service and init in project:
import { ExtensionLogsService } from '@pouch/extension-logs';
const logsService = new ExtensionLogsService();
logsService.init({
clientToken: '{DataDog client token}',
env: 'local', // 'local' | 'production' | 'staging'
origin: 'background', // 'background' | 'content' | 'popup' | 'page'
service: '{brand}:extension',
sessionId: '{Megatron clientHash}',
version: chrome.runtime.getManifest().version,
});
const data: any = {'x': 'y'}; // additional log data
logsService.debug('debug message', data);