In this new post Juozas Kaziukenas takes a look at a very useful debugging tool that can help keep your debug messages and errors out of your page and into a proper debugger - FirePHP (an extension of Firebug).
One may debug his application with print(") statements all other the place or alert(") for JavaScript. Luckily some years ago Firebug extension for Firefox was introduced, which introduced (?) console. Console works absolutely the same as in Linux and can be used not only to execute commands, but receive information from various sources.
He shows what the output looks like both on the interface side (in the Firefox plugin) and in the HTTP headers that are sent back along with the web server's response. Some frameworks even have components that let you interface with it directly.