From: Adam Dickmeiss Date: Mon, 6 Jun 2005 12:32:03 +0000 (+0000) Subject: Allow log level to be set for zoomsh X-Git-Tag: YAZ.2.1.8~5 X-Git-Url: http://git.indexdata.com/?a=commitdiff_plain;h=c516122e7966c81722715371eb899655979adc8a;p=yaz-moved-to-github.git Allow log level to be set for zoomsh --- diff --git a/zoom/zoomsh.c b/zoom/zoomsh.c index 89c0239..2d59221 100644 --- a/zoom/zoomsh.c +++ b/zoom/zoomsh.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: zoomsh.c,v 1.34 2005-06-06 10:45:33 adam Exp $ + * $Id: zoomsh.c,v 1.35 2005-06-06 12:32:03 adam Exp $ */ /* ZOOM-C Shell */ @@ -586,8 +586,24 @@ static void zoomsh(int argc, char **argv) int main(int argc, char **argv) { - int mask = yaz_log_mask_str("zoom"); - yaz_log_init_level(mask); + const char *maskstr = 0; + if (argc > 2 && !strcmp(argv[1], "-v")) + { + maskstr = argv[2]; + argv += 2; + argc -= 2; + } + else if (argc > 1 && !strncmp(argv[1], "-v", 2)) + { + maskstr = argv[1]+2; + argv++; + argc--; + } + if (maskstr) + { + int mask = yaz_log_mask_str(maskstr); + yaz_log_init_level(mask); + } nmem_init(); zoomsh(argc, argv); nmem_exit();