Changeset ca974d7 for lib/xmltree.c


Ignore:
Timestamp:
2011-12-04T19:14:29Z (12 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
df98ee8
Parents:
bd31661
Message:

Debug output tweaks: Try to send everything to stderr, and add ifdef to
enable printing of all SSL traffic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/xmltree.c

    rbd31661 rca974d7  
    330330        /* Indentation */
    331331        for( c = node; c->parent; c = c->parent )
    332                 printf( "    " );
     332                fprintf( stderr, "    " );
    333333       
    334334        /* Start the tag */
    335         printf( "<%s", node->name );
     335        fprintf( stderr, "<%s", node->name );
    336336       
    337337        /* Print the attributes */
     
    339339        {
    340340                char *v = g_markup_escape_text( node->attr[i].value, -1 );
    341                 printf( " %s=\"%s\"", node->attr[i].key, v );
     341                fprintf( stderr, " %s=\"%s\"", node->attr[i].key, v );
    342342                g_free( v );
    343343        }
     
    348348        if( node->text == NULL && node->children == NULL )
    349349        {
    350                 printf( "/>\n" );
     350                fprintf( stderr, "/>\n" );
    351351                return;
    352352                /* Then we're finished! */
     
    354354       
    355355        /* Otherwise... */
    356         printf( ">" );
     356        fprintf( stderr, ">" );
    357357       
    358358        /* Only print the text if it contains more than whitespace (TEST). */
     
    363363                {
    364364                        char *v = g_markup_escape_text( node->text, -1 );
    365                         printf( "%s", v );
     365                        fprintf( stderr, "%s", v );
    366366                        g_free( v );
    367367                }
     
    369369       
    370370        if( node->children )
    371                 printf( "\n" );
     371                fprintf( stderr, "\n" );
    372372       
    373373        for( c = node->children; c; c = c->next )
     
    376376        if( node->children )
    377377                for( c = node; c->parent; c = c->parent )
    378                         printf( "    " );
     378                        fprintf( stderr, "    " );
    379379       
    380380        /* Non-empty tag is now finished. */
    381         printf( "</%s>\n", node->name );
     381        fprintf( stderr, "</%s>\n", node->name );
    382382}
    383383
Note: See TracChangeset for help on using the changeset viewer.