Hi,
I wanted to be able to include the current data and time in log
messages. Here's a simple patch ...
Just include the '[date_time]' keyword in your log message attribute
and the current date and time will be inluded in the log line. (It
will work anywhere a keyword works.)
Cheers,
Mick.
---8<---
diff -c -r sipp-1.1rc8.src-un+branch/call.cpp sipp-1.1rc8.src/call.cpp
*** sipp-1.1rc8.src-un+branch/call.cpp Tue Apr 10 23:21:22 2007
--- sipp-1.1rc8.src/call.cpp Thu Apr 12 07:50:57 2007
***************
*** 2149,2154 ****
--- 2149,2162 ----
if (next_req_url) {
dest += sprintf(dest, "%s", next_req_url);
}
+ } else if(strstr(keyword, "date_time")) {
+ time_t tim;
+ char tbuf[32];
+ time(&tim);
+ ctime_r(&tim, tbuf);
+ tbuf[strlen(tbuf)-1] = '\0';
+ /* Message index in scenario */
+ dest += sprintf(dest, "%s", tbuf);
} else if(strstr(keyword, "len")) {
length_marker = dest;
dest += sprintf(dest, " ");
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users