B.1. Logging
Logging helps you understand what functions and middleware are being run, shows you what errors your application is producing, and provides better insight into what’s going on in your application.
The console module is a core Node.js module and a global object, which means that you can access the console keyword anywhere in your application code. When you run console.log(), passing some message as a string of text, the output typically is printed in a terminal window or a file. For the purposes of this book, the console module offers the right logging tools for dissecting your application code. Aside from the logging tips in lesson 2, a few logging commands are important to keep in mind.
The console module has two outputs: standard ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access