The long list of logs into the console it's too thick and sometimes makes hard to debug own component. I suggest thinking about using a method that, instead of using console.log() directly, first checks if the config for logs is set and is true and then console.log().
In any case, logs shouldn't be printed in production mode like vuejs framework already does.
Good idea. It should be set in config - we鈥檝e moved to console.debug in most places but chrome displays the message anyway
we鈥檝e moved to console.debug in most places but chrome displays the message anyway
in my honest opinion there should never be nothing in console, the problem is not the message "level" but the message itself.
Console printing terribly affects performance, this test shows the problem: https://jsperf.com/console-log-performance
A solution is to totally strip it out using a Webpack Uglify plugin for example.
if you want to keep the messages for debugging purpose it's a good idea using a properly message level and "tagging" it for example:
console.info('[USER] now the user is logged')
console.debug('[USER] retrived token for user')
console.info('[CART] added product x to cart')
@mdanilowicz @DavidRouyer @vue-kacper maybe you would like to take care of this one? I think we should have some global logger instance like: Vue.prototype.$logger with methods like: log, warn, error + using kind of config.consoleVerbosityLevel.server|client (we probably like to have different level of errors reported client (in production - nothing) and server side
Why not printing anything unless there is a problem?
That鈥檚 fine - please just make it configurable for some dev. scenarios as well?
@NataliaTepluhina I've added the configuration option:
"console": {
"verbosityLevel": "only-errors"
},
Available options: only-errors - displays only error messages, no-console - silent mode, display-everything - displays everything (it may be usefull for development purposes)
Could You please update the docs with this info?