From 028cd0d846e6e44649ef699e205b2db453be5522 Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Thu, 20 Oct 2005 19:28:03 +0000 Subject: [PATCH] Added option -m to GFS to control formatting of time stamps. --- NEWS | 2 ++ doc/gfs-options.xml | 10 +++++++++- src/statserv.c | 13 ++++++++++--- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 9834091..e410645 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +Added option -m to GFS to control formatting of timestamps in log file. + Added 'exit' as synonym for 'quit' in yaz-client Possible compatibility problems with earlier versions marked with '*'. diff --git a/doc/gfs-options.xml b/doc/gfs-options.xml index 7091155..92c7499 100644 --- a/doc/gfs-options.xml +++ b/doc/gfs-options.xml @@ -1,5 +1,5 @@ @@ -171,6 +171,14 @@ . + + -m + time-format + + Sets the format of time-stamps in the log-file. Specify a string in + the input format to strftime(). + + diff --git a/src/statserv.c b/src/statserv.c index 95643f4..f5aa6d1 100644 --- a/src/statserv.c +++ b/src/statserv.c @@ -5,7 +5,7 @@ * NT threaded server code by * Chas Woodfield, Fretwell Downing Informatics. * - * $Id: statserv.c,v 1.32 2005-08-22 20:34:21 adam Exp $ + * $Id: statserv.c,v 1.33 2005-10-20 19:28:04 quinn Exp $ */ /** @@ -1299,7 +1299,7 @@ int check_options(int argc, char **argv) yaz_log_init_level(control_block.loglevel); get_logbits(1); - while ((ret = options("1a:iszSTl:v:u:c:w:t:k:d:A:p:DC:f:", + while ((ret = options("1a:iszSTl:v:u:c:w:t:k:d:A:p:DC:f:m:", argv, argc, &arg)) != -2) { switch (ret) @@ -1338,6 +1338,13 @@ int check_options(int argc, char **argv) option_copy(control_block.logfile, arg); yaz_log_init(control_block.loglevel, me, control_block.logfile); break; + case 'm': + if (!arg) { + fprintf(stderr, "%s: Specify time format for log file.\n", me); + return(1); + } + yaz_log_time_format(arg); + break; case 'v': control_block.loglevel = yaz_log_mask_str_x(arg,control_block.loglevel); @@ -1406,7 +1413,7 @@ int check_options(int argc, char **argv) fprintf(stderr, "Usage: %s [ -a -v " " -l -u -c -t " " -k -d -p -C certfile" - " -ziDST1 -w ... ]\n", me); + " -ziDST1 -m -w ... ]\n", me); return 1; } } -- 1.7.10.4