Il 11/04/2009 15.15, Viktor Szakáts ha scritto:
BTW, what if we'd extend our current trace API with an option (controlled by envvar HB_TR_WINOUTDBG=yes|no|only) to push or also push message via OutputDebugString()?

This function can be used then, instead of hb_tooutdebug():
HB_TRACESTRING()

We could also add timestamp to trace messages. What other features may be missing from HB_TRACESTRING() which are present and important in HB_TOOUTDEBUG()?


What I need is a function that permits a syntax like sprintf (but possibly on prg level adding possibility to have any type transformed to a string) limited to a part of code, without to have to enable tracing for every HB_TRACE() calls. And possibly to show result in a separate window that I can have opened side-by-side with application I want to trace. And, on Windows, if it uses dbgview (that I found a real useful utility already ready to use) it will be good. And this has to be present either on prg than on c level possibly with same syntax. Now if you want to call it hb_TraceString() or any other name for me it is not important. Last addition I found useful (that I have in my own implementation) is a flag that when is active add stack trace on every function display (like TraceLog() function in xharbour that has the limit to not handle sprintf() syntax).

Actually if I write:
hb_ToOutDebug( "This is a number = %i, string = %s or any other type of sprintf or prg = %s\n\r", 30, "a string", { "an", "array" } )

I get in dbgview:
#  Time      Debug  Print
33 23.43.25 [5856] This is a number = 30, string = a string or any other type of sprintf or prg = A
MyFunction(10) in test.prg
Main(2) in test.prg

Another interesting addition can be to add a flag that permits to have defined where output have to be sent (like EXTERNAL WINDOW | FILE | BOTH, where EXTERNAL WINDOW can be dbgview in windows or a text file showed in a separate window) so I can have same tracing information sent both on dbgview than in a file.

The needs is to add some debugging / tracing functions to handle debugging of applications. I don't know how you work, but I don't think that you debug your application only with ? or printf() and if yes if them are enough.

Also internal debug it's not enough in some occasions (like MT applications AFAIK).

Hope I'm clear.

Best regards,
Francesco

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to