in reply to Error-checking and logging
While I generally agree with you on the importance of logging, I have a couple of comments:
A minor one first:
Built-in functions. How many times have you seen someone write: open HANDLE, ">myfile"; What if there is no space on the drive? The program will crash the first time HANDLE is written to, cause it wasn't opened successfully.
The problem is not usually a lack of space on the disk, 99% of the time it is with user rights: the file you want to write already exists and is owned by someone else.
Then something a little more philosophical:
As for logging ... it's usually the only way you know what your program has done. When I write something, it spews out tons of crap onto the screen. 99% of it, I will never use. 99% of the time, I won't use the other 1%. That 1% of the time ... My! how that 1% of the logging has saved me days of work.
I don't know about that. Code that fills the screen with useless log/warning info is just likely to make you miss the one message that was really important and that should have gotten your attention. Instead it got lost in the flow of usual crap that your program generates. So unless I can also provide the user with tools to filter the output, I usually stick to outputting only the most important warnings, while providing ways to generate additional logging if need be.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Error-checking and logging
by dragonchild (Archbishop) on Feb 26, 2002 at 16:55 UTC | |
|
Re: Re: Error-checking and logging
by grep (Monsignor) on Feb 26, 2002 at 18:13 UTC |