]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/SafeSyslog.pm
bump version to 8.2.1
[pve-common.git] / src / PVE / SafeSyslog.pm
index c61e97ae9465edfcbb19b1394a0e1430b111bf92..af105a15d08536638bdd8a0dd31d6f1b5790764e 100644 (file)
@@ -13,18 +13,22 @@ our $VERSION = '1.00';
 our @EXPORT = qw(syslog initlog);
 
 my $log_tag = "unknown";
+
 # never log to console - thats too slow, and
 # it corrupts the DBD database connection!
 
 sub syslog {
-    eval { Sys::Syslog::syslog (@_); }; # ignore errors
+    my ($level, @param) = @_;
+
+    $level = 'warning' if $level eq 'warn';
+
+    eval { Sys::Syslog::syslog ($level, @param); }; # ignore errors
 }
 
 sub initlog {
     my ($tag, $facility) = @_;
 
-    if ($tag) { 
+    if ($tag) {
        $tag = basename($tag);
 
        $tag = encode("ascii", decode_utf8($tag));