public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH common] syslog: interpret priority level 'warn' correctly
@ 2023-06-14 13:05 Fiona Ebner
  2023-06-14 15:43 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fiona Ebner @ 2023-06-14 13:05 UTC (permalink / raw)
  To: pve-devel

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@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@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





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH common] syslog: interpret priority level 'warn' correctly
  2023-06-14 13:05 [pve-devel] [PATCH common] syslog: interpret priority level 'warn' correctly Fiona Ebner
@ 2023-06-14 15:43 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-06-14 15:43 UTC (permalink / raw)
  To: Proxmox VE development discussion, Fiona Ebner

Am 14/06/2023 um 15:05 schrieb Fiona Ebner:
> 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@proxmox.com>
> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
> ---
>  src/PVE/SafeSyslog.pm | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-14 15:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-14 13:05 [pve-devel] [PATCH common] syslog: interpret priority level 'warn' correctly Fiona Ebner
2023-06-14 15:43 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal