From a6fd755d34b38dfdae0efd1715571863a4d290d0 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 16 Jul 2007 09:09:56 +0000 Subject: [PATCH] One more record dump to be tweaked to use log file --- src/logic.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/logic.c b/src/logic.c index f8a8f4d..d5e8cf9 100644 --- a/src/logic.c +++ b/src/logic.c @@ -1,4 +1,4 @@ -/* $Id: logic.c,v 1.52 2007-07-16 09:00:22 adam Exp $ +/* $Id: logic.c,v 1.53 2007-07-16 09:09:56 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -248,7 +248,7 @@ xmlDoc *record_to_xml(struct session_database *sdb, Z_External *rec) FILE *lf = yaz_log_file(); if (lf) { - yaz_log(YLOG_LOG, "Normalized record from %s", db->url); + yaz_log(YLOG_LOG, "Un-normalized record from %s", db->url); #if LIBXML_VERSION >= 20600 xmlDocFormatDump(lf, rdoc, 1); #else @@ -288,13 +288,19 @@ xmlDoc *normalize_record(struct session_database *sdb, Z_External *rec) } if (global_parameters.dump_records) { - fprintf(stderr, "Record from %s\n----------------\n", - sdb->database->url); + FILE *lf = yaz_log_file(); + + if (lf) + { + yaz_log(YLOG_LOG, "Normalized record from %s", + sdb->database->url); #if LIBXML_VERSION >= 20600 - xmlDocFormatDump(stderr, rdoc, 1); + xmlDocFormatDump(lf, rdoc, 1); #else - xmlDocDump(stderr, rdoc); + xmlDocDump(lf, rdoc); #endif + fprintf(lf, "\n"); + } } } return rdoc; -- 1.7.10.4