The Science of Debugging
Chapter 5


5.4 Closing notes about logs

This section is mainly for the CircleMUD programmers out there; those who opt to use the 'log()' function in their code.

There's another sort of logging function in CircleMUD; mudlog(). Don't use it for debugging. It's intent is to give information to immortals currently logged into the mud.

Often times, a log'ed message will be followed up by a mudlog'ed message. That's fine, but if you examine these, these almost never contain debugging information - instead they're usually things like status changes, entrance/exit of the mud by a player, and the sort. To make matters worse, they're a bit more complex and the syntax isn't the most intuitive.

I have written one-time commands that simply spew out lists of info - to be run from inside the mud, but it's always routed via 'log' into a file. Unless the bug is something that does not cause a crash, and doesn't occur often (and you need to know exactly WHEN it does occur), then stick to using just 'log()'.

For the advanced programmers out there, if you use log() in patches you write, you should prefix your error message with the phrase "SYSERR:" and for wizard-level commands, prefix "(GC)" . This is not a fixed standard, but it is the expected usage. Grep through the code to see examples.



Index
5.3 Complex Bugs, Complex Logs 6. Debugging Using gdb