projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Expand test to enabled modules logging with log level
[yaz-moved-to-github.git]
/
test
/
test_log.c
diff --git
a/test/test_log.c
b/test/test_log.c
index
5e77136
..
faf2822
100644
(file)
--- a/
test/test_log.c
+++ b/
test/test_log.c
@@
-24,11
+24,12
@@
int main(int argc, char **argv)
{
char *arg;
int i, ret;
{
char *arg;
int i, ret;
- int level = YLOG_LOG;
+ int message_level = YLOG_LOG;
+ int module_no = 0;
int number = 1;
unsigned int wait_between_log = 0;
int number = 1;
unsigned int wait_between_log = 0;
- while ((ret = options("f:p:v:l:m:n:r:w:Hh", argv, argc, &arg)) != -2)
+ while ((ret = options("f:p:v:l:m:M:n:r:w:Hh", argv, argc, &arg)) != -2)
{
switch (ret)
{
{
switch (ret)
{
@@
-54,7
+55,10
@@
int main(int argc, char **argv)
number = atoi(arg);
break;
case 'm':
number = atoi(arg);
break;
case 'm':
- level = yaz_log_module_level(arg);
+ module_no = yaz_log_module_level(arg);
+ break;
+ case 'M':
+ message_level = yaz_log_module_level(arg);
break;
case 'w':
wait_between_log = atoi(arg);
break;
case 'w':
wait_between_log = atoi(arg);
@@
-65,7
+69,7
@@
int main(int argc, char **argv)
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(module_no|message_level, "%d %s", i, arg);
#if HAVE_UNISTD_H
if (wait_between_log)
sleep(wait_between_log);
#if HAVE_UNISTD_H
if (wait_between_log)
sleep(wait_between_log);
@@
-75,7
+79,7
@@
int main(int argc, char **argv)
case 'h':
default:
fprintf(stderr, "tstlog [-f logformat] [-v level] [-l file] "
case 'h':
default:
fprintf(stderr, "tstlog [-f logformat] [-v level] [-l file] "
- "[-p prefix] [-m module] [-w sec] [-r max] [-n num] [-H] msg ..\n");
+ "[-p prefix] [-m module] -M [message log level] [-w sec] [-r max] [-n num] [-H] msg ..\n");
exit(1);
}
}
exit(1);
}
}