Browse Source

Added "I:" for "Iteration", to use instead of inconsistent tags

Alois Mahdal 12 years ago
parent
commit
ca810e5e60
2 changed files with 6 additions and 1 deletions
  1. 3
    0
      README.md
  2. 3
    1
      cgi-bin/htlog/htlog.cgi

+ 3
- 0
README.md View File

@@ -10,6 +10,9 @@ Collects GET requests with parameters *msg*, *tag* and *i* and logs them into si
10 10
 *   *msg* is actual message body. It can be used to contain parseable data 
11 11
     like `name=john;age=32;state=il;`
12 12
 *   *tag* can be used to identify related messages like those from one test
13
+*   use *i* if you tend to write tags like `test01-002` and `test01-002` to 
14
+    store the iteration number, you'll be better off with this parameter as 
15
+    it won't break your ability to use tags
13 16
 
14 17
 
15 18
 ##htlogger.pm##

+ 3
- 1
cgi-bin/htlog/htlog.cgi View File

@@ -34,11 +34,13 @@ sub stamp {
34 34
 my $q = CGI->new;
35 35
 my $msg = ( defined $q->param('msg')    ? $q->param('msg')  : '-' );
36 36
 my $tag = ( defined $q->param('tag')    ? $q->param('tag')  : '-' );
37
+my $i   = ( defined $q->param('i')      ? $q->param('i')    : '-' );
37 38
 
38
-my $message = sprintf("Time: %s; Origin: %s; Tag: %s; Message: %s\n",
39
+my $message = sprintf("Time: %s; Origin: %s; Tag: %s; I: %s; Message: %s\n",
39 40
     &stamp(time),
40 41
     $ENV{'REMOTE_ADDR'},
41 42
     $tag,
43
+    $i,
42 44
     $msg
43 45
 );
44 46