aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authoryaworsky <yaworsky>2005-11-29 12:11:25 +0000
committeryaworsky <yaworsky>2005-11-29 12:11:25 +0000
commitc1144cf1e7c0af962487558c1136540eb254f0fe (patch)
tree45b838bf3e64b3108cf52ce006c6c390a7c69770 /test
parentf00b09866bbe1b8c47a45279d96fc1c8f7f92948 (diff)
downloadsyslog-win32-c1144cf1e7c0af962487558c1136540eb254f0fe.tar.gz
syslog-win32-c1144cf1e7c0af962487558c1136540eb254f0fe.tar.xz
syslog-win32-c1144cf1e7c0af962487558c1136540eb254f0fe.zip
Added prefix to message.
Diffstat (limited to 'test')
-rw-r--r--test/test.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/test.c b/test/test.c
index fe6d90e..bd3100c 100644
--- a/test/test.c
+++ b/test/test.c
@@ -67,11 +67,12 @@ main(int argc, char **argv) {
int max_identical = 0;
int iterations = 1;
char *tag = NULL;
+ char *msg_prefix = NULL;
FILETIME current_time, max_time;
unsigned long long max_time_64;
int msg_index, total_sent;
- while ((ch = getopt(argc, argv, "p:t:b:s:i:n:")) != -1)
+ while ((ch = getopt(argc, argv, "p:t:b:s:i:n:x:")) != -1)
switch((char)ch) {
case 'p': /* priority */
pri = pencode(optarg);
@@ -91,6 +92,9 @@ main(int argc, char **argv) {
case 'n': /* number of test iterations */
iterations = strtoul( optarg, NULL, 0 );
break;
+ case 'x': /* message prefix */
+ msg_prefix = optarg;
+ break;
case '?':
default:
usage();
@@ -113,7 +117,7 @@ main(int argc, char **argv) {
for(;;) {
int i;
for( i = 0; i < 100; i++ ) {
- syslog(pri, "test message %d", msg_index );
+ syslog(pri, "%stest message %d", msg_prefix? msg_prefix : "", msg_index );
messages_sent++;
total_sent++;
if( identic_index < identic_count )