Tuesday, 2 October 2018

node.js: console.group([...label]): logs message with indentation

console.group([...label])
It logs the message and increases indentation of subsequent lines by two spaces.

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


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



Previous                                                 Next                                                 Home

No comments:

Post a Comment