Console logs and front end

In the last article we switched our parties we went from the boys who tried to do everything on server to now pushing absolutely everything we can onto client side

But servers were cool because they gave us really nice logs The terminal was flowing with rich information we could use for debugging

Now since not much is happening on server the communication between server and client wont reveal much info

Thus we got a migrate our info farm To where the information is now being generated

The birds have migrated so shall the hunter

Things running on client side imply it’s all happening in browser

So now we have to figure out how to get logs from browser

And we are in luck because when you click F 12 you exactly open console of the browser

If you have implemented logging system properly then you can track something as miniscule as a mouse click on it

And that’s huge

You can track when a button is clicked and when that button is clicked did it trigger some communication in the app

How much time it took

You can also automate interactions in your front end by using this console such that you can get everything tested

You can say hey go onclick this button tell me if it is trying to communicate something if it is not if we manually communicate it is it working

In one go, now you are testing the responsiveness of your website and the connections between your back end and front end

Basically what I’m saying moving to client side has now reduced to complexity of your application and it has helped you automate testing in a more wholesome manner

You can always turn off logging in prod

Biggest advantage is that console is not just a read only thing it is an interactive environment