From d97bb5af15e77bfec1e8461afe475b5fe9d41106 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 16 Jul 2007 09:00:22 +0000 Subject: [PATCH] Option -d dumps records to the current log file instead of stderr. --- NEWS | 2 ++ src/logic.c | 18 +++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 4a565fa..a8b1eaa 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +Option -d dumps records to the current log file instead of stderr. + Fixes for compilation on cygwin. Z39.50 client code uses pz:elements. pz:elements was recognized in diff --git a/src/logic.c b/src/logic.c index ce3eee6..f8a8f4d 100644 --- a/src/logic.c +++ b/src/logic.c @@ -1,4 +1,4 @@ -/* $Id: logic.c,v 1.51 2007-07-13 09:25:41 adam Exp $ +/* $Id: logic.c,v 1.52 2007-07-16 09:00:22 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -243,15 +243,19 @@ xmlDoc *record_to_xml(struct session_database *sdb, Z_External *rec) return 0; } - if (global_parameters.dump_records){ - fprintf(stderr, - "Input Record (normalized) from %s\n----------------\n", - db->url); + if (global_parameters.dump_records) + { + FILE *lf = yaz_log_file(); + if (lf) + { + yaz_log(YLOG_LOG, "Normalized record from %s", db->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