Simple Logger

If you are programming in PHP, I bet you are using “prints and dies” to debug your code. I know its the easiest way to debug any web based program. But some time you “die” just don’t work, you need to know much more about programs flow and what’s happening under the hood.

There are testing and debugging tools available in the open source community like PHPUnit but you need to invest little more time to understand and use.

So as usual I tried simple logging to debug and keep track of “Prints”. Its simple and need no extra knowledge or installation procedure. Just include the class and use it to log the data you want to see after program is executed.

The wrapper:

Usage:

Isn’t it simple!

Add a Comment

Your email address will not be published. Required fields are marked *