Why is the console non-standard?

Looking at here you can find this post:

Non-standard

This function is non-standard and does not conform to track standards. Don't use it on production sites facing the internet: it won't work for every user. There may also be large incompatibilities between implementations and behavior may change in the future.

Obviously console

not intended for production and I suppose it is used by helluvalot people , so why hasn't it become standard or suggested as a standard? This is not DOM related, but could it not be an ECMAScript feature? It seems that host environments can always provide a way to output something to the console or choose to ignore it, so I see no harm in becoming the standard.

+3


source to share


2 answers


The same question was asked here where you can read the full post thread for all proponents and third party arguments Console API Standardization.

In a nutshell, there are suggestions for standardizing the console API, like this one (which is initiated by the guy who asked the question) It also contains useful information on other standardization efforts (documentation).

And with regard to your statement:



Obviously the console is not meant for production ...

It may not be intended for production, but there are times when it is useful in production, such as providing tips and detailed errors for professional users. For example, Facebook uses the Console API to print this warning banner.

enter image description here

+2


source


I'm just speculating - this is partly an issue due to backward compatibility, but also that a method implementation log

can do different things for different parameters to suit different browser designer needs is standard.

I don't know if you have seen this method -



if(window.console && console.log) {
    console.log('your message');
}

      

The next question may arise: how can we check for support within the parameters of a method log

, if it ever did, we need to offer standard support for this method.

+2


source







All Articles