This is the holy grail of debugging for me. It’s old school, simple and effective. It works both in browser and from command line. My code looks like:
console.log("Environment path: " + envPath);
You can make it fancier with debug levels (in
if() statements or with your tiny library). I however tend to add/remove them progressively as I resolve the issues.