marsadm: use stderr for errors and warnings

This commit is contained in:
Thomas Schoebel-Theuer 2014-01-20 13:31:21 +01:00
parent f9ea0132f3
commit 2b71a212de
1 changed files with 10 additions and 2 deletions

View File

@ -22,16 +22,24 @@ sub lprint {
} }
} }
sub lprint_stderr {
my ($text) = @_;
print STDERR $text;
if ($notify) {
system("/usr/bin/logger -t marsadm \"$notify $text\"");
}
}
sub ldie { sub ldie {
my ($text) = @_; my ($text) = @_;
$error_count++; $error_count++;
lprint "DYING: $text"; lprint_stderr "DYING: $text";
die "\n"; die "\n";
} }
sub lwarn { sub lwarn {
my ($text) = @_; my ($text) = @_;
lprint "WARNING: $text"; lprint_stderr "WARNING: $text";
} }
################################################################## ##################################################################