Index: libfdproto/dictionary.c
===================================================================
--- libfdproto/dictionary.c	(revision 662)
+++ libfdproto/dictionary.c	(revision 687)
@@ -1304,48 +1304,48 @@
 
 /* Default dump functions */
-static void dump_val_os(union avp_value * value)
+static void dump_val_os(union avp_value * value, FILE * fstr)
 {
 	int i;
 	for (i = 0; i < value->os.len; i++) {
 		if (i == 24) { /* Dump only up to 24 bytes of the buffer */
-			fd_log_debug("[...] (len=%zd)", value->os.len);
+			fd_log_debug_fstr(fstr, "[...] (len=%zd)", value->os.len);
 			break;
 		}
-		fd_log_debug("%02.2X ", value->os.data[i]);
-	}
-}
-
-static void dump_val_i32(union avp_value * value)
-{
-	fd_log_debug("%i (0x%x)", value->i32, value->i32);
-}
-
-static void dump_val_i64(union avp_value * value)
-{
-	fd_log_debug("%lli (0x%llx)", value->i64, value->i64);
-}
-
-static void dump_val_u32(union avp_value * value)
-{
-	fd_log_debug("%u (0x%x)", value->u32, value->u32);
-}
-
-static void dump_val_u64(union avp_value * value)
-{
-	fd_log_debug("%llu (0x%llx)", value->u64, value->u64);
-}
-
-static void dump_val_f32(union avp_value * value)
-{
-	fd_log_debug("%f", value->f32);
-}
-
-static void dump_val_f64(union avp_value * value)
-{
-	fd_log_debug("%g", value->f64);
+		fd_log_debug_fstr(fstr, "%02.2X ", value->os.data[i]);
+	}
+}
+
+static void dump_val_i32(union avp_value * value, FILE * fstr)
+{
+	fd_log_debug_fstr(fstr, "%i (0x%x)", value->i32, value->i32);
+}
+
+static void dump_val_i64(union avp_value * value, FILE * fstr)
+{
+	fd_log_debug_fstr(fstr, "%lli (0x%llx)", value->i64, value->i64);
+}
+
+static void dump_val_u32(union avp_value * value, FILE * fstr)
+{
+	fd_log_debug_fstr(fstr, "%u (0x%x)", value->u32, value->u32);
+}
+
+static void dump_val_u64(union avp_value * value, FILE * fstr)
+{
+	fd_log_debug_fstr(fstr, "%llu (0x%llx)", value->u64, value->u64);
+}
+
+static void dump_val_f32(union avp_value * value, FILE * fstr)
+{
+	fd_log_debug_fstr(fstr, "%f", value->f32);
+}
+
+static void dump_val_f64(union avp_value * value, FILE * fstr)
+{
+	fd_log_debug_fstr(fstr, "%g", value->f64);
 }
 
 /* Get the dump function for basic dict_avp_basetype */
-static void (*get_default_dump_val_cb(enum dict_avp_basetype datatype))(union avp_value *)
+static void (*get_default_dump_val_cb(enum dict_avp_basetype datatype))(union avp_value *, FILE *)
 {
 	switch (datatype) {
@@ -1382,32 +1382,32 @@
 
 /* Formater for the AVP value dump line */
-static void dump_avp_val(union avp_value *avp_value, void (*dump_val_cb)(union avp_value *avp_value), enum dict_avp_basetype datatype, char * type_name, char * const_name, int indent)
+static void dump_avp_val(union avp_value *avp_value, void (*dump_val_cb)(union avp_value *, FILE *), enum dict_avp_basetype datatype, char * type_name, char * const_name, int indent, FILE * fstr)
 {
 	/* Header for all AVP values dumps: */
-	fd_log_debug(INOBJHDR "value ", INOBJHDRVAL);
+	fd_log_debug_fstr(fstr, INOBJHDR "value ", INOBJHDRVAL);
 	
 	/* If the type is provided, write it */
 	if (type_name)
-		fd_log_debug("t: '%s' ", type_name);
+		fd_log_debug_fstr(fstr, "t: '%s' ", type_name);
 	
 	/* Always give the base datatype anyway */
-	fd_log_debug("(%s) ", type_base_name[datatype]);
+	fd_log_debug_fstr(fstr, "(%s) ", type_base_name[datatype]);
 	
 	/* Now, the value */
-	fd_log_debug("v: ");
+	fd_log_debug_fstr(fstr, "v: ");
 	if (const_name)
-		fd_log_debug("'%s' (", const_name);
-	(*dump_val_cb)(avp_value);
+		fd_log_debug_fstr(fstr, "'%s' (", const_name);
+	(*dump_val_cb)(avp_value, fstr);
 	if (const_name)
-		fd_log_debug(")");
+		fd_log_debug_fstr(fstr, ")");
 	
 	/* Done! */
-	fd_log_debug("\n");
+	fd_log_debug_fstr(fstr, "\n");
 }
 
 /* Dump the value of an AVP of known type */
-void fd_dict_dump_avp_value(union avp_value *avp_value, struct dict_object * model, int indent)
-{
-	void (*dump_val_cb)(union avp_value *avp_value);
+void fd_dict_dump_avp_value(union avp_value *avp_value, struct dict_object * model, int indent, FILE * fstr)
+{
+	void (*dump_val_cb)(union avp_value *avp_value, FILE * fstr);
 	struct dict_object * type = NULL;
 	char * type_name = NULL;
@@ -1444,5 +1444,5 @@
 	
 	/* And finally, dump the value */
-	dump_avp_val(avp_value, dump_val_cb, model->data.avp.avp_basetype, type_name, const_name, indent);
+	dump_avp_val(avp_value, dump_val_cb, model->data.avp.avp_basetype, type_name, const_name, indent, fstr);
 }
 
