X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftstlog.c;h=c41089b64707c772ae65b76a637c6763f635e5a8;hb=5c5f9a65dedbaa37af4d1ba772568a176c9762a7;hp=743da7fed88515c640c5a3b53e56f714ac1e3b38;hpb=4c176312acdc3444c9afc820f76a393e64668e52;p=yaz-moved-to-github.git diff --git a/test/tstlog.c b/test/tstlog.c index 743da7f..c41089b 100644 --- a/test/tstlog.c +++ b/test/tstlog.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: tstlog.c,v 1.4 2005-01-15 19:47:15 adam Exp $ + * $Id: tstlog.c,v 1.7 2005-09-09 10:20:14 adam Exp $ * */ #include @@ -13,34 +13,50 @@ int main(int argc, char **argv) { char *arg; - int ret; + int i, ret; int level = YLOG_LOG; + int number = 1; - while ((ret = options("f:v:l:m:", argv, argc, &arg)) != -2) + while ((ret = options("f:v:l:m:n:s:", argv, argc, &arg)) != -2) { - switch (ret) - { - case 'f': - yaz_log_time_format(arg); - break; - case 'v': - yaz_log_init_level(yaz_log_mask_str(arg)); - break; - case 'l': - yaz_log_init_file(arg); - break; - case 'm': - level = yaz_log_module_level(arg); - break; - case 0: - yaz_log(level, "%s", arg); - break; - default: - fprintf(stderr, "tstlog. Bad option\n"); - fprintf(stderr, "tstlog [-f logformat] [-v level] [-l file] " - "[-m module] msg ..\n"); - exit(1); - } + switch (ret) + { + case 's': + yaz_log_init_max_size(atoi(arg)); + break; + case 'f': + yaz_log_time_format(arg); + break; + case 'v': + yaz_log_init_level(yaz_log_mask_str(arg)); + break; + case 'l': + yaz_log_init_file(arg); + break; + case 'n': + number = atoi(arg); + break; + case 'm': + level = yaz_log_module_level(arg); + break; + case 0: + for (i = 0; i