Q:

Winston not displaying text when comma is used as concatenation operator

My project is right now making use of winston logger to log to console. The problem is, comma is used as concatenation operator in most areas,
Like logger.info("here is data", data ) 
data is a string always, but what gets logged is "here is data" only and nothing else.
Project uses comma as concat in most places so replacing with '+' is tedious. Please favour on how to display data in presence of comma itself 

A:

you have basically two ways around it
1) manually change your logger.info function to take multi parameters, or write a logger wrapper that will concatenate the string before passing on to logger.info
info = (...args) => {
   const data = args.reduce((acc, item) => acc += item);
   // or such kind of manual concatenation logic
   logger.info(data);
}

2) use es6 Template literals. so instead of logger.info("here is data", data), use 
logger.info(`here is data ${data}`)

