n8n/packages/workflow/src/LoggerProxy.ts
कारतोफ्फेलस्क्रिप्ट™ 05586a900d
refactor(core): Make Logger a service (no-changelog) (#7494)
2023-10-25 16:35:22 +02:00

17 lines
609 B
TypeScript

import type { Logger } from './Interfaces';
const noOp = () => {};
export let error: Logger['error'] = noOp;
export let warn: Logger['warn'] = noOp;
export let info: Logger['info'] = noOp;
export let debug: Logger['debug'] = noOp;
export let verbose: Logger['verbose'] = noOp;
export const init = (logger: Logger) => {
error = (message, meta) => logger.error(message, meta);
warn = (message, meta) => logger.warn(message, meta);
info = (message, meta) => logger.info(message, meta);
debug = (message, meta) => logger.debug(message, meta);
verbose = (message, meta) => logger.verbose(message, meta);
};