views:

91

answers:

2

I'm embarrassed to post this but it's been awhile since I worked in C++, been with C# for awhile. I'm converting old (not written by me) vs2003 and 05 C++ code to vs 08. In addition to lots of lumps during conversion, I want to add debug logging so I can monitor what is going on when I attach with windbg. I've searched the archives here and ms and I think it's using Debugger.Log(...) but not sure. I also remember years ago launching a debug monitor to catch the logging. So the call to some experts that have a better memory than I. What call(s) can I make (without the DEBUG compile directive - need to watch release code) to catch the logging in wind bag? I followed a couple of debugging links from SO posts but they were dead. Thanx - Old Man.

+1  A: 

The WinAPI function OutputDebugString() sends a string to the attached debugger if one is attached.

James McNellis
Great! Thanks many.
ddm
A: 

You can use outputdebugstring and log the data you want to monitor. Additionally open Dbgview.exe tool to check the data being logged. This is the best way to capture data by running the service in release mode. The data you capture in dbgview you can store in a file and use for different purposes at a later point of time. Hope this helps

ckv