Re: DEBUGMSG : output to a file
- From: "Graeme Wintle" <graememsng@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 3 Jan 2008 15:08:01 -0000
This is a little crude but its easy to add to a number of drivers etc, what
i do is overrider the RETAIL/DEBUG msg macro and plug in my own writing to a
file, the advantage of this is that you can see the log after a reboot or as
part of a shutdown without having a debug cable / serial port.
So:
extern void myLogPrnt( const WCHAR* wszFormat, ... );
#define RETAILMSG(a,b) {myLogPrnt b;}
Then define in the module somewhere:
FILE* gLogFile = NULL;
WCHAR wszBuffer[4096];
void myLogPrnt( const WCHAR* wszFormat, ... )
{
int nCount;
va_list args;
// Write formatted string
va_start( args, wszFormat );
nCount = _vsnwprintf( wszBuffer, 10024, wszFormat, args );
va_end( args );
// Check for buffer exceed length
if( -1 == nCount )
{
nCount = 4096 - 1;
wszBuffer[nCount] = 0;
}
// log to file
gLogFile = _wfopen( L"\\log.txt", L"a" );
fseek(gLogFile, SEEK_END, 0);
fwprintf(gLogFile, L"%d:%s", GetTickCount(), wszBuffer);
fclose(gLogFile);
}
This prints out the tick count as well otherwise you have no idea about the
speed the debug was being produced
--
--
GraemeW
Blog - http://ce4all.blogspot.com
"mosfet" <john.doe@xxxxxxxxxxxxx> wrote in message
news:477b6eb8$0$5362$426a74cc@xxxxxxxxxxxxxxx
Hi,
Is there any standard way to output debug trace (DEBUGMSG) into a file ?
I would like to debug the sms provider .
.
- References:
- DEBUGMSG : output to a file
- From: mosfet
- DEBUGMSG : output to a file
- Prev by Date: Re: softreboot make a shutdown :-(
- Next by Date: Re: Communication with Pocket PC device through USB
- Previous by thread: Re: DEBUGMSG : output to a file
- Next by thread: Re: Creation of a RAM drive in WM5 based devices??
- Index(es):
Relevant Pages
|