MCPcopy Create free account
hub / github.com/codecombat/codecombat / log

Function log

ozaria/site/common/logger.js:11–32  ·  view source on GitHub ↗
(action, options = {}, status = 'info')

Source from the content-addressed store, hash-verified

9 * @param {string} status - status of the log, values can be 'debug', 'info', 'warn', 'error'
10 */
11export 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.

Callers

nothing calls this directly

Calls 2

useDataDogMethod · 0.80
logMethod · 0.80

Tested by

no test coverage detected