| "use strict"; |
| Object.defineProperty(exports, "__esModule", { value: true }); |
| exports.trackEvent = trackEvent; |
| exports.trackError = trackError; |
| function trackEvent(name, data) { |
| const timestamp = new Date().toISOString(); |
| const eventData = { |
| timestamp, |
| event: name, |
| ...data |
| }; |
| console.log('[ANALYTICS]', JSON.stringify(eventData)); |
| } |
| function trackError(error, context) { |
| const timestamp = new Date().toISOString(); |
| const errorData = { |
| timestamp, |
| event: 'ERROR', |
| error: error.message, |
| stack: error.stack, |
| ...context |
| }; |
| console.error('[ANALYTICS_ERROR]', JSON.stringify(errorData)); |
| } |
| |