admin管理员组

文章数量:1323369

I am currently working with nodejs application. We use console.log for server side printing purpose, But here logger.log also used. Both will do the same work, but logger.log isn't able to be used more than once in a function like below

logger.log('check level 1')
logger.log('check level 2')

anybody can help?

I am currently working with nodejs application. We use console.log for server side printing purpose, But here logger.log also used. Both will do the same work, but logger.log isn't able to be used more than once in a function like below

logger.log('check level 1')
logger.log('check level 2')

anybody can help?

Share Improve this question edited Jul 7, 2016 at 7:46 Pete 58.5k29 gold badges130 silver badges184 bronze badges asked Jul 7, 2016 at 7:37 SuperKrishSuperKrish 2251 gold badge3 silver badges11 bronze badges 3
  • Are you using this? If not it looks like you are using another library. Can you hunt it? – David González Commented Jul 7, 2016 at 7:42
  • 1 logger.log isn't part of node. You're using a library. Read the documentation for that library. – Mulan Commented Jul 7, 2016 at 7:45
  • Even if he's using winston or log4js, I don't see how the logger wouldn't be able to log twice in the same function. – Pierre Arlaud Commented Jul 7, 2016 at 7:46
Add a ment  | 

1 Answer 1

Reset to default 4

Finally I got Answer,

Console.log

  • only shows the output in console, doesnot store on anywhere. It only used on runtime

logger.log

logger is the customized class in my project, which enables with utiles modules for debugging modules.

if i missed anything, please point out my mistakes

本文标签: javascriptDifference between consolelog and loggerlog in Node JSStack Overflow