Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Logging in CGI (http://www.go4expert.com/forums/logging-in-cgi-t17309/)

gamodg 4May2009 08:41

Logging in CGI
I have a cgi controller that takes requests and depending on request it invokes the object of the desired class which generates a XML and sends the XML as a response.
On the client this XML is combined with XSL to display a HTML page.

For ex.


  request---->controller------->router.cgi(a linked list of name value pair is generated and passed to XML.c)-------->XML(using libxml library )-------->client(XML+XSL=HTML).
My problem is that if anybody prints something to debug a code that goes as a response since I am using print to send response and the XML breaks.

How can I debug my code without breaking the XML.
Please suggest an approach or a framework that can be employed here.

pradeep 4Sep2009 12:33

Re: Logging in CGI
To debug, write to the error log instead of the response.

All times are GMT +5.5. The time now is 10:31.