pier        01/07/19 16:50:03

  Modified:    webapp/lib wa_main.c
  Log:
  Better debugging output.
  
  Revision  Changes    Path
  1.9       +8 -4      jakarta-tomcat-connectors/webapp/lib/wa_main.c
  
  Index: wa_main.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/lib/wa_main.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- wa_main.c 2001/07/13 01:15:36     1.8
  +++ wa_main.c 2001/07/19 23:50:03     1.9
  @@ -55,7 +55,7 @@
    *                                                                           *
    * ========================================================================= */
   
  -/* @version $Id: wa_main.c,v 1.8 2001/07/13 01:15:36 pier Exp $ */
  +/* @version $Id: wa_main.c,v 1.9 2001/07/19 23:50:03 pier Exp $ */
   #include <wa.h>
   
   /* The current APR memory pool. */
  @@ -189,6 +189,9 @@
   /* Dump some debugging information. */
   void wa_debug(const char *f, const int l, const char *fmt, ...) {
   #ifdef DEBUG
  +    char hdr[128];
  +    char dta[640];
  +    char buf[768];
       apr_time_t at;
       char st[128];
       va_list ap;
  @@ -196,9 +199,10 @@
       at=apr_time_now();
       apr_ctime(st, at);
       va_start(ap,fmt);
  -    fprintf(stderr,"[%s] %d (%s:%d) ",st,getpid(),f,l);
  -    vfprintf(stderr,fmt,ap);
  -    fprintf(stderr,"\n");
  +    apr_snprintf(hdr,128,"[%s] %d (%s:%d)",st,getpid(),f,l);
  +    apr_vsnprintf(dta,640,fmt,ap);
  +    apr_snprintf(buf,728,"%s %s\n",hdr,dta);
  +    fprintf(stderr,"%s",buf);
       fflush(stderr);
       va_end(ap);
   #endif /* ifdef DEBUG */
  
  
  

Reply via email to