Tuesday 2 October 2018

node.js: console.info([data][, ...args]): logs the message

console.info([data][, ...args])
It logs the message to stdout with new line. Multiple arguments can be passed, with the first used as the primary message and all additional used as substitution values.

HelloWorld.js
console.info("User '%s' login failed", "Krishna");
console.info("Please retry after some time");
console.info("If you forgot the password, please contact administrator");


Output
User 'Krishna' login failed
Please retry after some time
If you forgot the password, please contact administrator




Previous                                                 Next                                                 Home

No comments:

Post a Comment