Let your code record its activities ...
- Writing a diary is a good practice
- Blogging is a great hobby
These serve to enhance your memory and recall about incidents and events at a later point of time. Let us extend this habit to your code too. Your program should normally get cultivated with a practice of recording (logging) its activities lucidly without swamping the resources.
That way, we get to reap a lot of benefits. A few are:
- Troubleshooting problems with the application
- Statistics about the application
There are excellent log frameworks available for any one to get started with minimum effort. A few are: