admin管理员组文章数量:1323197
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
1 Answer
Reset to default 4Finally 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
版权声明:本文标题:javascript - Difference between console.log and logger.log in Node JS - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742125614a2421926.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论