http://www.perlmonks.org?node_id=928980


in reply to Re: Same thing as last night, Pinky, try and take over the world!
in thread Philosophy: Got the Data, Now what?

Since you can edit the messages in the C source, I suggest adding a unique but easily distinguished error ID code to each one. For example:

"Something bad happened. (err0r_aaaa)" "Oh crap - you're hosed. (err0r_aaab)" "The thingamajig dumped. (err0r_aaac)"
Then a simple $ grep -rin err0r * in the top-level source directory will result in something like:
some/dir/something.c:42: dump_err("The thingamajig dumped. (err +0r_aaac)"); some/thisthing.c:32: log("Something bad happened. (err0r_aaaa)"); thatthing.c:41: return "Oh crap - you're hosed. (err0r_aaab)";
which you can split into path/filename, line#, and error message to update whatever you use to track the error messages.

Bonus, whenever someone receives an error message you can use the (idcode) to determine the exact source of the message, even if different .c files have otherwise identical messages.