X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Ftstlog.c;h=0d7338e5f463c729f10b26e763d3060786a9ea8c;hb=7e156f9a105b894b600c78d0b0a55224ae9b9793;hp=8bce12fc62d102767b6dbdc252c863b9855872a3;hpb=fb6d99a0c7e07d9cc4a315c447deaf6564a85505;p=yaz-moved-to-github.git diff --git a/test/tstlog.c b/test/tstlog.c index 8bce12f..0d7338e 100644 --- a/test/tstlog.c +++ b/test/tstlog.c @@ -2,24 +2,32 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: tstlog.c,v 1.5 2005-06-25 15:46:07 adam Exp $ + * $Id: tstlog.c,v 1.8 2005-09-16 21:14:38 adam Exp $ * */ #include #include #include #include +#if HAVE_UNISTD_H +#include +#endif int main(int argc, char **argv) { char *arg; - int ret; + int i, ret; int level = YLOG_LOG; + int number = 1; + unsigned int wait_between_log = 0; - while ((ret = options("f:v:l:m:", argv, argc, &arg)) != -2) + while ((ret = options("f:v:l:m:n:s:w:", argv, argc, &arg)) != -2) { switch (ret) { + case 's': + yaz_log_init_max_size(atoi(arg)); + break; case 'f': yaz_log_time_format(arg); break; @@ -29,16 +37,29 @@ int main(int argc, char **argv) case 'l': yaz_log_init_file(arg); break; + case 'n': + number = atoi(arg); + break; case 'm': level = yaz_log_module_level(arg); break; + case 'w': + wait_between_log = atoi(arg); + break; case 0: - yaz_log(level, "%s", arg); + for (i = 0; i