/opt/canhelp/node_modules/@opentelemetry/api/build/esnext/diag
NameSizeModeActions
internal/-0755rm
ComponentLogger.d.ts8410644editdlrm
ComponentLogger.js13540644editdlrm
ComponentLogger.js.map27040644editdlrm
consoleLogger.d.ts19800644editdlrm
consoleLogger.js25420644editdlrm
consoleLogger.js.map56740644editdlrm
types.d.ts43550644editdlrm
types.js13490644editdlrm
types.js.map48460644editdlrm
Edit: /opt/canhelp/node_modules/@opentelemetry/api/build/esnext/diag/consoleLogger.js.map (5674B)
{"version":3,"file":"consoleLogger.js","sourceRoot":"","sources":["../../../src/diag/consoleLogger.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,UAAU,GAAiD;IAC/D,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE;IAC1B,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE;IACxB,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE;IACxB,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE;IAC1B,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE;CAC7B,CAAC;AAEF,gFAAgF;AAChF,+EAA+E;AAC/E,0DAA0D;AAC1D,MAAM,CAAC,MAAM,uBAAuB,GAEhC,EAAE,CAAC;AACP,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;IAClC,MAAM,IAAI,GAA+B;QACvC,OAAO;QACP,MAAM;QACN,MAAM;QACN,OAAO;QACP,OAAO;QACP,KAAK;KACN,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,sCAAsC;QACtC,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,UAAU,EAAE;YACtC,sCAAsC;YACtC,uBAAuB,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;SAC7C;KACF;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,iBAAiB;IAC5B;QACE,SAAS,YAAY,CAAC,QAAwB;YAC5C,OAAO,UAAU,GAAG,IAAI;gBACtB,2EAA2E;gBAC3E,IAAI,OAAO,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;gBAChD,mFAAmF;gBACnF,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;oBACjC,OAAO,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAC;iBAC1C;gBACD,8FAA8F;gBAC9F,IAAI,OAAO,OAAO,KAAK,UAAU,IAAI,OAAO,EAAE;oBAC5C,sCAAsC;oBACtC,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;oBAC5B,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;wBACjC,sCAAsC;wBACtC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC;qBACvB;iBACF;gBACD,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;oBACjC,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;iBACrC;YACH,CAAC,CAAC;QACJ,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACvD;IACH,CAAC;CAkCF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DiagLogger, DiagLogFunction } from './types';\n\ntype ConsoleMapKeys = 'error' | 'warn' | 'info' | 'debug' | 'trace';\nconst consoleMap: { n: keyof DiagLogger; c: ConsoleMapKeys }[] = [\n { n: 'error', c: 'error' },\n { n: 'warn', c: 'warn' },\n { n: 'info', c: 'info' },\n { n: 'debug', c: 'debug' },\n { n: 'verbose', c: 'trace' },\n];\n\n// Save original console methods at module load time, before any instrumentation\n// can wrap them. This ensures DiagConsoleLogger calls the unwrapped originals.\n// Exported for testing only — not part of the public API.\nexport const _originalConsoleMethods: Partial<\n Record\n> = {};\nif (typeof console !== 'undefined') {\n const keys: (ConsoleMapKeys | 'log')[] = [\n 'error',\n 'warn',\n 'info',\n 'debug',\n 'trace',\n 'log',\n ];\n for (const key of keys) {\n // eslint-disable-next-line no-console\n if (typeof console[key] === 'function') {\n // eslint-disable-next-line no-console\n _originalConsoleMethods[key] = console[key];\n }\n }\n}\n\n/**\n * A simple Immutable Console based diagnostic logger which will output any messages to the Console.\n * If you want to limit the amount of logging to a specific level or lower use the\n * {@link createLogLevelDiagLogger}\n *\n * @since 1.0.0\n */\nexport class DiagConsoleLogger implements DiagLogger {\n constructor() {\n function _consoleFunc(funcName: ConsoleMapKeys): DiagLogFunction {\n return function (...args) {\n // Prefer original (pre-instrumentation) methods saved at module load time.\n let theFunc = _originalConsoleMethods[funcName];\n // Some environments only expose the console when the F12 developer console is open\n if (typeof theFunc !== 'function') {\n theFunc = _originalConsoleMethods['log'];\n }\n // Fall back in case console was not available at module load time but became available later.\n if (typeof theFunc !== 'function' && console) {\n // eslint-disable-next-line no-console\n theFunc = console[funcName];\n if (typeof theFunc !== 'function') {\n // eslint-disable-next-line no-console\n theFunc = console.log;\n }\n }\n if (typeof theFunc === 'function') {\n return theFunc.apply(console, args);\n }\n };\n }\n\n for (let i = 0; i < consoleMap.length; i++) {\n this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);\n }\n }\n\n /** Log an error scenario that was not expected and caused the requested operation to fail. */\n public error!: DiagLogFunction;\n\n /**\n * Log a warning scenario to inform the developer of an issues that should be investigated.\n * The requested operation may or may not have succeeded or completed.\n */\n public warn!: DiagLogFunction;\n\n /**\n * Log a general informational message, this should not affect functionality.\n * This is also the default logging level so this should NOT be used for logging\n * debugging level information.\n */\n public info!: DiagLogFunction;\n\n /**\n * Log a general debug message that can be useful for identifying a failure.\n * Information logged at this level may include diagnostic details that would\n * help identify a failure scenario. Useful scenarios would be to log the execution\n * order of async operations\n */\n public debug!: DiagLogFunction;\n\n /**\n * Log a detailed (verbose) trace level logging that can be used to identify failures\n * where debug level logging would be insufficient, this level of tracing can include\n * input and output parameters and as such may include PII information passing through\n * the API. As such it is recommended that this level of tracing should not be enabled\n * in a production environment.\n */\n public verbose!: DiagLogFunction;\n}\n"]}