Logging in CGI

Discussion in 'C' started by gamodg, May 4, 2009.

  1. gamodg

    gamodg New Member

    Joined:
    Mar 22, 2009
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    Hi
    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.

    Code:
      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.
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    48
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    To debug, write to the error log instead of the response.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice