node-custom-logger
v1.0.2
Published
help managing application log
Downloads
4
Readme
initailize
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);
logging
logger.error({ code: 999, message: 'error message' });
output
{
level: 'error',
timestamp: 1705037099205,
content: { common: 'common message', code: 999, message: 'error message' }
}