Selaa lähdekoodia

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

Alois Mahdal 12 vuotta sitten
vanhempi
commit
ca810e5e60
2 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 3
    0
      README.md
  2. 3
    1
      cgi-bin/htlog/htlog.cgi

+ 3
- 0
README.md Näytä tiedosto

10
 *   *msg* is actual message body. It can be used to contain parseable data 
10
 *   *msg* is actual message body. It can be used to contain parseable data 
11
     like `name=john;age=32;state=il;`
11
     like `name=john;age=32;state=il;`
12
 *   *tag* can be used to identify related messages like those from one test
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
 ##htlogger.pm##
18
 ##htlogger.pm##

+ 3
- 1
cgi-bin/htlog/htlog.cgi Näytä tiedosto

34
 my $q = CGI->new;
34
 my $q = CGI->new;
35
 my $msg = ( defined $q->param('msg')    ? $q->param('msg')  : '-' );
35
 my $msg = ( defined $q->param('msg')    ? $q->param('msg')  : '-' );
36
 my $tag = ( defined $q->param('tag')    ? $q->param('tag')  : '-' );
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
     &stamp(time),
40
     &stamp(time),
40
     $ENV{'REMOTE_ADDR'},
41
     $ENV{'REMOTE_ADDR'},
41
     $tag,
42
     $tag,
43
+    $i,
42
     $msg
44
     $msg
43
 );
45
 );
44
 
46