Handle hostnames with upper-case letters
[webmin.git] / cluster-shell / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'cluster-shell-lib.pl';
5
6 # parse_webmin_log(user, script, action, type, object, &params)
7 # Converts logged information from this module into human-readable form
8 sub parse_webmin_log
9 {
10 local ($user, $script, $action, $type, $object, $p, $long) = @_;
11 if ($action eq 'clear') {
12         return $text{'log_clear'};
13         }
14 elsif ($action eq 'run') {
15         local @server = split(/\0/, $p->{'run'});
16         if ($long) {
17                 return &text('log_run_l', "<tt>$p->{'cmd'}</tt>",
18                      join(", ", map { $_ ? "<tt>$_</tt>"
19                                          : $text{'index_this'} } @server));
20                 }
21         else {
22                 return &text('log_run', "<tt>$p->{'cmd'}</tt>",
23                                         scalar(@server));
24                 }
25         }
26 }
27