What’s better than outputdebugstring for windows debugging

debuggingwindows

So, before I came to my current place of employment, the windows OutputDebugString function was completely unheard of, everyone was adding debug messages to string lists and saving them to file or doing showmessage popups (not very useful for debugging drawing issues). Now everybody (all 6 of us) is like "What can I say about this OutputDebugString?" and I'm like, "with much power comes much responsibility."

I kind of feel as though I've passed a silent but deadly code smell to my colleagues. Ideally we wouldn't have bugs to debug right? Ideally we'd have over 0% code coverage, eh? So as far as petty debugging is concerned (not complete rewriting of a 3 million line Delphi behemoth) what's a better way to use debug running code than just adding OutputDebugString all over?

Best Answer

Well, if you've got access to an interactive debugger with breakpoints and watches and all, I'd suggest that. If you don't want an interactive debugger, how about a logging utility? Log4J is a good logger for Java apps, and there's a .NET equivalent as well (log4net).

Related Topic