const logger = require('node-custom-logger');
const print = (data) => {
console.log(data);
};
const cbList = {
trace: console.log,
debug: console.log,
info: console.log,
warning: print,
error: print,
fatal: print,
};
const commonContents = { common: 'common message', };
logger.initialize(cbList, commonContent);
logger.error({ code: 999, message: 'error message' });
{
level: 'error',
timestamp: 1705037099205,
content: { common: 'common message', code: 999, message: 'error message' }
}