[thelist] Web Dev Program

Eduardo Kienetz eduardok at gmail.com
Mon Jul 9 14:50:52 CDT 2007


On 7/9/07, Anthony Baratta <anthony at baratta.com> wrote:
> Ahhhh... Grasshopper - we have much to learn about the way of code. ;-)
>
> tip author="Anthony Baratta" type="Comments and Logging in Code"
>
> As a good designer and coder you should be commenting your code for future reference. If not for yourself, for others to follow up later with. But what about logging?
>
> Depending on the coding language and platform, you should also be building logging options to your code. With the flip of a boolean or the setting of a string you can have your inline logging collecting and spitting out data for your perusal.
>
> The few extra minutes it takes to write a line or two, or make a conditional call to your logging functions at strategic locations within your code is time well spent as your application becomes larger and more complex.

Logging is definitely powerful. I usually have a debug(text) function
with something like:
if(file_exists('log_on.txt'))
 echo $text;

So if I want to turn logging off I just remove that log_on.txt file...

-- 
Eduardo Bacchi Kienetz
LPI Certified - Level 2
http://www.noticiaslinux.com.br/eduardo/



More information about the thelist mailing list