From b35d5a130a1094f9960cf99b76f98b6040096d98 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 15 May 2007 21:27:55 +0000 Subject: [PATCH] Added option pazpar2 option -l to specify logfile. Removed usage msg and removed description for no longer supported options. --- src/pazpar2.c | 71 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/src/pazpar2.c b/src/pazpar2.c index 721f501..7895117 100644 --- a/src/pazpar2.c +++ b/src/pazpar2.c @@ -1,4 +1,4 @@ -/* $Id: pazpar2.c,v 1.83 2007-04-23 21:05:23 adam Exp $ +/* $Id: pazpar2.c,v 1.84 2007-05-15 21:27:55 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -39,40 +39,45 @@ int main(int argc, char **argv) if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) yaz_log(YLOG_WARN|YLOG_ERRNO, "signal"); - yaz_log_init(YLOG_DEFAULT_LEVEL, "pazpar2", 0); + yaz_log_init_prefix("pazpar2"); - while ((ret = options("t:f:x:h:p:z:s:d", argv, argc, &arg)) != -2) + while ((ret = options("f:h:p:z:t:l:d", argv, argc, &arg)) != -2) { - switch (ret) { - case 'f': - if (!read_config(arg)) - exit(1); - break; - case 'h': - strcpy(global_parameters.listener_override, arg); - break; - case 'p': - strcpy(global_parameters.proxy_override, arg); - break; - case 'z': - strcpy(global_parameters.zproxy_override, arg); - break; - case 't': - strcpy(global_parameters.settings_path_override, arg); - break; - case 'd': - global_parameters.dump_records = 1; - break; - default: - fprintf(stderr, "Usage: pazpar2\n" - " -f configfile\n" - " -h [host:]port (REST protocol listener)\n" - " -C cclconfig\n" - " -s simpletargetfile\n" - " -p hostname[:portno] (HTTP proxy)\n" - " -z hostname[:portno] (Z39.50 proxy)\n" - " -d (show internal records)\n"); - exit(1); + switch (ret) + { + case 'f': + if (!read_config(arg)) + exit(1); + break; + case 'h': + strcpy(global_parameters.listener_override, arg); + break; + case 'p': + strcpy(global_parameters.proxy_override, arg); + break; + case 'z': + strcpy(global_parameters.zproxy_override, arg); + break; + case 't': + strcpy(global_parameters.settings_path_override, arg); + break; + case 'd': + global_parameters.dump_records = 1; + break; + case 'l': + yaz_log_init_file(arg); + break; + default: + fprintf(stderr, "Usage: pazpar2\n" + " -f configfile\n" + " -h [host:]port (REST protocol listener)\n" + " -p hostname[:portno] (HTTP proxy)\n" + " -z hostname[:portno] (Z39.50 proxy)\n" + " -t settings\n" + " -d (show internal records)\n" + " -l file log to file\n" + ); + exit(1); } } -- 1.7.10.4