CnPack Forum


 
Subject: Don't know how to use CnDebug
seekbirdy
新警察
Rank: 1


UID 26058
Digest Posts 0
Credits 13
Posts 5
点点分 13
Reading Access 10
Registered 2007-9-13
Location Fryazino, Russia
Status Offline
Post at 2007-9-13 20:41  Profile | Blog | P.M. 
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!




cherchez l'oiseau
Top
shenloqi
灌水处处长
Rank: 4



UID 34
Digest Posts 1
Credits 287
Posts 179
点点分 287
Reading Access 10
Registered 2003-3-15
Status Offline
Post at 2007-9-14 13:48  Profile | P.M. 
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.
Top
seekbirdy
新警察
Rank: 1


UID 26058
Digest Posts 0
Credits 13
Posts 5
点点分 13
Reading Access 10
Registered 2007-9-13
Location Fryazino, Russia
Status Offline
Post at 2007-9-17 15:34  Profile | Blog | P.M. 
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.




cherchez l'oiseau
Top
yj_yulin
新警察
Rank: 1



UID 20352
Digest Posts 0
Credits 10
Posts 5
点点分 10
Reading Access 10
Registered 2007-7-17
Status Offline
Post at 2007-9-22 23:11  Profile | Blog | P.M. 
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.
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6750
Posts 3551
点点分 6750
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2007-9-23 01:51  Profile | Blog | P.M. 
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.
Top
seekbirdy
新警察
Rank: 1


UID 26058
Digest Posts 0
Credits 13
Posts 5
点点分 13
Reading Access 10
Registered 2007-9-13
Location Fryazino, Russia
Status Offline
Post at 2007-9-24 15:10  Profile | Blog | P.M. 
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  

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




cherchez l'oiseau
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6750
Posts 3551
点点分 6750
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2007-9-24 18:13  Profile | Blog | P.M. 
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.
Top
seekbirdy
新警察
Rank: 1


UID 26058
Digest Posts 0
Credits 13
Posts 5
点点分 13
Reading Access 10
Registered 2007-9-13
Location Fryazino, Russia
Status Offline
Post at 2007-9-24 21:32  Profile | Blog | P.M. 
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!

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


Attachment: [CnDebug.pas with output to a file] CnDebug.pas (2007-9-24 21:32, 75.7 K)
Download count 825




cherchez l'oiseau
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6750
Posts 3551
点点分 6750
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2007-9-25 02:31  Profile | Blog | P.M. 
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.
http://www.cnpack.org/showdetail.php?id=372

Or, wait for a new nightly build version of CnWizards tommorow or a few days later.
Top
seekbirdy
新警察
Rank: 1


UID 26058
Digest Posts 0
Credits 13
Posts 5
点点分 13
Reading Access 10
Registered 2007-9-13
Location Fryazino, Russia
Status Offline
Post at 2007-9-25 14:19  Profile | Blog | P.M. 
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.




cherchez l'oiseau
Top
Passion (LiuXiao)
管理员
Rank: 9Rank: 9Rank: 9


UID 359
Digest Posts 19
Credits 6750
Posts 3551
点点分 6750
Reading Access 102
Registered 2004-3-28
Status Offline
Post at 2007-9-27 15:55  Profile | Blog | P.M. 
0.8.2.333 unstable comes out. You can download it from:

http://www.cnpack.org/downbuilds.php
Top
 




All times are GMT++8, the time now is 2024-3-28 23:47

    本论坛支付平台由支付宝提供
携手打造安全诚信的交易社区 Powered by Discuz! 5.0.0  © 2001-2006 Comsenz Inc.
Processed in 0.009009 second(s), 8 queries , Gzip enabled

Clear Cookies - Contact Us - CnPack Website - Archiver - WAP