mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-27 02:55:21 +00:00
REST environment: add static log_warn function
which avoids the need for the caller to check whether the environment was initialized or not. Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
cc78c1eba2
commit
06885ac8bb
@ -715,6 +715,17 @@ sub fork_worker {
|
||||
return wantarray ? ($upid, $res) : $upid;
|
||||
}
|
||||
|
||||
sub log_warn {
|
||||
my ($message) = @_;
|
||||
|
||||
if ($rest_env) {
|
||||
$rest_env->warn($message);
|
||||
} else {
|
||||
chomp($message);
|
||||
print STDERR "WARN: $message\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub warn {
|
||||
my ($self, $message) = @_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user