From 92ee7569d83bf0302c2c02a3adc851e631bea06f Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 24 Apr 2013 15:17:20 +0200 Subject: [PATCH] Allow timeformat for log to be specified with option -m (as Metaproxy and YAZ GFS). Suggested by Sven Porst. --- doc/pazpar2.xml | 12 ++++++++++++ src/pazpar2.c | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/pazpar2.xml b/doc/pazpar2.xml index 4cbe5f8..19e39ec 100644 --- a/doc/pazpar2.xml +++ b/doc/pazpar2.xml @@ -34,6 +34,7 @@ + @@ -117,6 +118,17 @@ + -m timeformat + + Sets the format of time-stamps for logging. + Refer to the + + strftime(3) + man page for the format. + + + diff --git a/src/pazpar2.c b/src/pazpar2.c index 80a7f59..6266d71 100644 --- a/src/pazpar2.c +++ b/src/pazpar2.c @@ -118,7 +118,7 @@ static int sc_main( yaz_log_init_prefix("pazpar2"); yaz_log_xml_errors(0, YLOG_WARN); - while ((ret = options("dDf:h:l:p:R:tu:v:Vw:X", argv, argc, &arg)) != -2) + while ((ret = options("dDf:h:l:m:p:R:tu:v:Vw:X", argv, argc, &arg)) != -2) { switch (ret) { @@ -138,6 +138,9 @@ static int sc_main( yaz_log_init_file(arg); log_file_in_use = 1; break; + case 'm': + yaz_log_time_format(arg); + break; case 'p': pidfile = arg; break; @@ -181,6 +184,7 @@ static int sc_main( " -f configfile Configuration\n" " -h [host:]port Listener port\n" " -l file Log to file\n" + " -m logformat log time format (strftime)\n" " -p pidfile PID file\n" " -R recfile HTTP recording file\n" " -t Test configuration\n" -- 1.7.10.4