console.log
or any console methods are for showing any information on browser developer console
It varies, Production
env means it's solely for end user
and everything is correct to make your website useful. That is why websites have dev
/ QA
/ Stage
env where you want to have some information for developers
.
console.log
or any methods associated to console
uses developer console
of the browser, with that said it's clear that it totally meant for someone who is using your website more then just getting information [hacker, developer, auditor, ]
etc.
For End user
which we expect to be just the normal people who are on your website for their need and don't have any technical requirement, then loggin an error
to console is useless ! Instead you need some kind of pop up or notification to inform end user that something went wrong or any useful information.
But there is kind of useful scenarios which you want to inform user to avoid any bad activity suggested by any hacker. Like facebook
does, as many of the hacker uses JS
snippets to do some automatic changes to website ask normal users to use console and post their snippets. In this case console
methods are useful
