Especially when printing errors, I write console.log or console.error.
I learned the program on my own, so I wrote it confusedly without knowing the two meanings
There seems to be a strange difference, so I wonder exactly how you use it.
Thank you!
javascript angularjs
What is displayed in the developer tool is different. The error appears as if it were an error, and it is also used in the developer tool to stand up and refer to the log only or to the error only. You can check it if you actually take a picture with Chrome developer tools.
Standard streams include stdin, stdout, and stderr
console.log corresponds to stdout and console.error corresponds to stderr. The output on the screen is the same, but it's a completely different output. In fact, for node.js, console.log is output as stdout and console.error as stderr. With the following command: The contents of console.log(stdout) are only found in the file stdout.txtnode test.js 2> stderr.txt 1> stdout.txt
The contents of console.error(stderr) can only be saved in a file called stderr.txt.
© 2024 OneMinuteCode. All rights reserved.