[pve-devel] [PATCH common] syslog: interpret priority level 'warn' correctly
Fiona Ebner
f.ebner at proxmox.com
Wed Jun 14 15:05:58 CEST 2023
There are some use sites, e.g. HA manager, pvescheduler that
incorrectly use priority level 'warn'. Likely because that is allowed
for some other log helpers in the codebase. Instead of fixing them all
one-by-one, simply allow 'warn' as a priority too.
Suggested-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
---
src/PVE/SafeSyslog.pm | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/PVE/SafeSyslog.pm b/src/PVE/SafeSyslog.pm
index 7d3e7a7..af105a1 100644
--- a/src/PVE/SafeSyslog.pm
+++ b/src/PVE/SafeSyslog.pm
@@ -18,7 +18,11 @@ my $log_tag = "unknown";
# 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 {
--
2.39.2
More information about the pve-devel
mailing list