Handle hostnames with upper-case letters
[webmin.git] / cluster-cron / log_parser.pl
1 # log_parser.pl
2 # Functions for parsing this module's logs
3
4 do 'cluster-cron-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 'exec') {
12         local @server = split(/\0/, $p->{'run'});
13         if ($long) {
14                 return &text('log_run_l', "<tt>$p->{'cluster_command'}</tt>",
15                      join(", ", map { $_ ? "<tt>$_</tt>"
16                                          : $text{'index_this'} } @server));
17                 }
18         else {
19                 return &text('log_run', "<tt>$p->{'cluster_command'}</tt>",
20                                         scalar(@server));
21                 }
22         }
23 elsif ($action eq 'deletes') {
24         return &text('log_deletes', $object);
25         }
26 else {
27         local $l = $long ? "_l" : "";
28         return &text("log_${action}${l}", "<tt>$object</tt>",
29                      "<tt>".&html_escape($p->{'cluster_command'})."</tt>");
30         }
31 }
32