CnPack Forum » CnWizards IDE Wizards » Don't know how to use CnDebug

2007-9-13 20:41 seekbirdy
Don't know how to use CnDebug

Hello All!

At first, thanks a lot for the great stuff!

My problem is that I didn't manage how to make CnDebugger work.
As I understood from the manual, it's enough just to add CnDebug.pas to my uses list
and to use CnDebugger global object's functions.

But when I run CnDebug Viewer nothing is displayed...
Should some $DEFINE's be set or whatever else?

Thanks in advance!

2007-9-14 13:48 shenloqi
If you use debug viewer in vista, you should run debug viewer as administrator. (even you did that, debug viewer sometimes still not work properly in vista)

To enable debug viewer to debug your application, you should build your application with the conditional: DEBUG or ALLDEBUG. You can set it in project options -> Directories/Conditionals. Once you set the conditional, you should build (not compile) your application to make the conditional work.

2007-9-17 15:34 seekbirdy
Thanks a lot! The conditional was the missing component. All is working!

But an extra question: could the log (trace) info be automatically saved into the file by default
(without using the CnDebugViewer)? I want to make some kind of usage statistics in my application.

Thanks in advance.

2007-9-22 23:11 yj_yulin
you have the cndebug.pas ,
i think redirect the message to file is not so hard,
but of course, it is good to have the option to just log the messge and don't show the viewer.

2007-9-23 01:51 Passion
CnDebugger's protected method "InternalOutputMsg" is used to put all fields to Channel. If interesting, you can modify it and redirect to a file.
It will be so nice if you can implement it and we canl add your enhancement to our CnDebug.pas.:)

2007-9-24 15:10 seekbirdy
:) well, thanx for the hint, I've implemented the simple output into a file...
But can I somehow transform it into XML that could be later opened by the Load command in Viewer?
Is there any specification (DTD, XML Schema, ...) or maybe src file of this transformation?
If this can be done, I'd like to submit an enchancement to you; but if no, there is a 10 lines of code
that should be added for simply output to a file... I'm not sure if  it's  worth to do  :)

[[i] Last edited by  seekbirdy at 2007-9-24 15:16 [/i]]

2007-9-24 18:13 Passion
XML writing need XML lib. it's not included in CnDebug.pas. We want to make CnDebug.pas clean, So I think the format of output may only be text.

CnDebugViewer uses OmniXML lib to write messages to XML format. Maybe we can add a "load from txt" function in CnDebugViewer.

2007-9-24 21:32 seekbirdy
Ok, anyway thanks a lot!
Sending a pretty silly enhancement with output to a file.
Here is it (in attachment).

Just set FileName property of CnDebugger to the desired filename.
Text is not formatted in the output file, so waiting for a feature in a CnDebugViewer! :)

[[i] Last edited by  seekbirdy at 2007-9-24 21:33 [/i]]

2007-9-25 02:31 Passion
OK.?Thanks for your contribution.?You'll in our credits.

I've merge your modification to our CVS and add a property DumpToFile: Boolean to control this behaviour. File extension use "*.cdd". it means CnDebug Dump. :)
A condition DUMP_TO_FILE can?also be used to enable it.

And CnDebugViewer now can read cdd file and display it.

If interesting ,you can use CVS to obtain the latest code and compile a CnDebugViewer to verify it for us.

Or, wait for a new nightly build version of CnWizards tommorow or a few days later.

2007-9-25 14:19 seekbirdy
Thank you so much for the feature!

Sorry but I can't download the sources from CSV today due to traffic limitation...
Maybe I could do it in a few days... or just download a nightly build mentioned by you :)
Dunno what will come earlier.

2007-9-27 15:55 Passion unstable comes out. You can download it from:


页: [1]
查看完整版本: Don't know how to use CnDebug

Powered by Discuz! Archiver 5.0.0  © 2001-2006 Comsenz Inc.