I use Winston for my backend logging I cannot log the object without using JSON.stringify
which is annoying
logger.debug(`Register ${JSON.stringify(
Or you just use the
printf
function in conjunction with JSON.stringify
new winston.transports.Console({
format: winston.format.combine(
winston.format.colorize(),
winston.format.simple(),
winston.format.printf(context => {
const msgstr = JSON.stringify(context.message, null, '\t')
return `[${context.level}]${msgstr}`
}),
),
})