Added files for Juan

This commit is contained in:
2024-08-07 11:38:48 -07:00
parent f7878e3e60
commit 795d1d72ce
2871 changed files with 621552 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
/* istanbul ignore file */
const LOG_METHODS = ['error', 'warn', 'info', 'debug', 'trace', 'silent'];
export default function getLogger(component) {
return LOG_METHODS.reduce((acc, cur) => {
const prop = cur;
// check if the method is available on console (web doesn't have
// 'silent', for example) before adding to acc
// eslint-disable-next-line no-console
if (console[prop]) {
// eslint-disable-next-line no-console
// @ts-ignore
acc[prop] = console[prop].bind(console, `${component}:`);
}
return acc;
}, {});
}
// logging interface expects a 'setLevel' method
getLogger.setLevel = () => { };
getLogger.setLogLevelsConfig = () => { };
getLogger.waitForBuffer = () => { };
getLogger.clearLogger = () => { };