Hi there.
Personally, I rarely use the Debug class at all for any of my programming. I've read a lot of comments and suggestions, such as those by John Robbins (author of Debugging .NET 2.0 Applications and the Bugslayer columns) about why you should be asserting proactively - especially parameters for methods.
The problem I have is this - say I was to write code like this:
Public Sub Test(source As Object)
Debug.Assert(source IsNot Nothing, "source is Nothing")
' Do something....
End Sub
This works well during development with debug builds, but I end up doing this anyway:
Public Sub Test(source As Object)
If source IsNot Nothing Then
' Do something....
End If
End Sub
If there's a chance for 'source' to be nothing, then I'm going to do an 'If' check on it anyway. I'm not going to leave the assert call in the release build.
The other reason I don't use the Debug class is that I write a lot of unit tests. Doing so has led me to covering a lot of code paths, thus having a Debug.Assert in my code is not required.
As for debug logging, then I simply use Trace calls and SysInternals DebugView or text files to log the output of trace calls.
I would love to hear from others on this topic, since I'm also interested in knowing how they might be using the Debug class during development. It's an area I don't have much experience in, so I'm eager to learn.
Cheers.
Jas.