projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c6a5dc8
)
New option -w sec for test log utility
author
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 16 Sep 2005 21:14:38 +0000
(21:14 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 16 Sep 2005 21:14:38 +0000
(21:14 +0000)
test/tstlog.c
patch
|
blob
|
history
diff --git
a/test/tstlog.c
b/test/tstlog.c
index
c41089b
..
0d7338e
100644
(file)
--- a/
test/tstlog.c
+++ b/
test/tstlog.c
@@
-2,13
+2,16
@@
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: tstlog.c,v 1.7 2005-09-09 10:20:14 adam Exp $
+ * $Id: tstlog.c,v 1.8 2005-09-16 21:14:38 adam Exp $
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <yaz/options.h>
#include <yaz/log.h>
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <yaz/options.h>
#include <yaz/log.h>
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
int main(int argc, char **argv)
{
int main(int argc, char **argv)
{
@@
-16,8
+19,9
@@
int main(int argc, char **argv)
int i, ret;
int level = YLOG_LOG;
int number = 1;
int i, ret;
int level = YLOG_LOG;
int number = 1;
+ unsigned int wait_between_log = 0;
- while ((ret = options("f:v:l:m:n:s:", argv, argc, &arg)) != -2)
+ while ((ret = options("f:v:l:m:n:s:w:", argv, argc, &arg)) != -2)
{
switch (ret)
{
{
switch (ret)
{
@@
-39,14
+43,23
@@
int main(int argc, char **argv)
case 'm':
level = yaz_log_module_level(arg);
break;
case 'm':
level = yaz_log_module_level(arg);
break;
+ case 'w':
+ wait_between_log = atoi(arg);
+ break;
case 0:
for (i = 0; i<number; i++)
case 0:
for (i = 0; i<number; i++)
+ {
yaz_log(level, "%d %s", i, arg);
yaz_log(level, "%d %s", i, arg);
+#if HAVE_UNISTD_H
+ if (wait_between_log)
+ sleep(wait_between_log);
+#endif
+ }
break;
default:
fprintf(stderr, "tstlog. Bad option\n");
fprintf(stderr, "tstlog [-f logformat] [-v level] [-l file] "
break;
default:
fprintf(stderr, "tstlog. Bad option\n");
fprintf(stderr, "tstlog [-f logformat] [-v level] [-l file] "
- "[-m module] [-s max] [-n num] msg ..\n");
+ "[-m module] [-w sec] [-s max] [-n num] msg ..\n");
exit(1);
}
}
exit(1);
}
}