From ca974d7f6171a70c5484420bd6c59919383105a6 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 4 Dec 2011 19:14:29 +0000 Subject: Debug output tweaks: Try to send everything to stderr, and add ifdef to enable printing of all SSL traffic. --- lib/xmltree.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib/xmltree.c') diff --git a/lib/xmltree.c b/lib/xmltree.c index 7dd7b6a3..e2654579 100644 --- a/lib/xmltree.c +++ b/lib/xmltree.c @@ -329,16 +329,16 @@ void xt_print( struct xt_node *node ) /* Indentation */ for( c = node; c->parent; c = c->parent ) - printf( " " ); + fprintf( stderr, " " ); /* Start the tag */ - printf( "<%s", node->name ); + fprintf( stderr, "<%s", node->name ); /* Print the attributes */ for( i = 0; node->attr[i].key; i ++ ) { char *v = g_markup_escape_text( node->attr[i].value, -1 ); - printf( " %s=\"%s\"", node->attr[i].key, v ); + fprintf( stderr, " %s=\"%s\"", node->attr[i].key, v ); g_free( v ); } @@ -347,13 +347,13 @@ void xt_print( struct xt_node *node ) /* If this tag doesn't have any content at all... */ if( node->text == NULL && node->children == NULL ) { - printf( "/>\n" ); + fprintf( stderr, "/>\n" ); return; /* Then we're finished! */ } /* Otherwise... */ - printf( ">" ); + fprintf( stderr, ">" ); /* Only print the text if it contains more than whitespace (TEST). */ if( node->text_len > 0 ) @@ -362,23 +362,23 @@ void xt_print( struct xt_node *node ) if( node->text[i] ) { char *v = g_markup_escape_text( node->text, -1 ); - printf( "%s", v ); + fprintf( stderr, "%s", v ); g_free( v ); } } if( node->children ) - printf( "\n" ); + fprintf( stderr, "\n" ); for( c = node->children; c; c = c->next ) xt_print( c ); if( node->children ) for( c = node; c->parent; c = c->parent ) - printf( " " ); + fprintf( stderr, " " ); /* Non-empty tag is now finished. */ - printf( "\n", node->name ); + fprintf( stderr, "\n", node->name ); } struct xt_node *xt_dup( struct xt_node *node ) -- cgit v1.2.3