(action, options = {}, status = 'info')
| 9 | * @param {string} status - status of the log, values can be 'debug', 'info', 'warn', 'error' |
| 10 | */ |
| 11 | export const log = (action, options = {}, status = 'info') => { |
| 12 | if (typeof ((window.DD_LOGS || {}).logger || {}).log !== 'function') { |
| 13 | if (me.useDataDog()) { |
| 14 | console.debug('DD_LOGS not available. Log: ', action) |
| 15 | } |
| 16 | return |
| 17 | } |
| 18 | |
| 19 | try { |
| 20 | if (globalVar.application && !globalVar.application.isProduction() || window.location.hostname === 'localhost') { |
| 21 | window.DD_LOGS.logger.setHandler('console') |
| 22 | } |
| 23 | |
| 24 | window.DD_LOGS.logger.log( |
| 25 | action, |
| 26 | options, |
| 27 | status |
| 28 | ) |
| 29 | } catch (e) { |
| 30 | console.warning('Error while sending datadog log', e) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Adds a global key value pair to include in all logs. |
nothing calls this directly
no test coverage detected