mirror of https://github.com/schoebel/mars
marsadm: use stderr for errors and warnings
This commit is contained in:
parent
f9ea0132f3
commit
2b71a212de
|
@ -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";
|
||||||
}
|
}
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
Loading…
Reference in New Issue