From: Daniel Kral <d.kral@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH ha-manager 1/7] sim: always limit the priority level to 4 characters
Date: Fri, 17 Apr 2026 14:27:16 +0200 [thread overview]
Message-ID: <20260417122728.330123-2-d.kral@proxmox.com> (raw)
In-Reply-To: <20260417122728.330123-1-d.kral@proxmox.com>
This is already done in the PVE::HA::Sim::TestEnv::log(), do the same
for the other Sim Env/Hardware implementations as any longer priority
level (such as 'warning') would produce a log line, where the priority
level would misalign the following time, log id and message columns.
Signed-off-by: Daniel Kral <d.kral@proxmox.com>
---
src/PVE/HA/Sim/Env.pm | 1 +
src/PVE/HA/Sim/Hardware.pm | 1 +
src/PVE/HA/Sim/RTEnv.pm | 1 +
src/PVE/HA/Sim/RTHardware.pm | 1 +
src/PVE/HA/Sim/TestHardware.pm | 1 +
5 files changed, 5 insertions(+)
diff --git a/src/PVE/HA/Sim/Env.pm b/src/PVE/HA/Sim/Env.pm
index 65d4efad..63368117 100644
--- a/src/PVE/HA/Sim/Env.pm
+++ b/src/PVE/HA/Sim/Env.pm
@@ -332,6 +332,7 @@ sub log {
chomp $msg;
my $time = $self->get_time();
+ $level = substr($level, 0, 4);
printf("%-5s %5d %12s: $msg\n", $level, $time, "$self->{nodename}/$self->{log_id}");
}
diff --git a/src/PVE/HA/Sim/Hardware.pm b/src/PVE/HA/Sim/Hardware.pm
index 82f85c97..163e35af 100644
--- a/src/PVE/HA/Sim/Hardware.pm
+++ b/src/PVE/HA/Sim/Hardware.pm
@@ -669,6 +669,7 @@ sub log {
chomp $msg;
my $time = $self->get_time();
+ $level = substr($level, 0, 4);
$id = 'hardware' if !$id;
diff --git a/src/PVE/HA/Sim/RTEnv.pm b/src/PVE/HA/Sim/RTEnv.pm
index ab5ac996..50d0731e 100644
--- a/src/PVE/HA/Sim/RTEnv.pm
+++ b/src/PVE/HA/Sim/RTEnv.pm
@@ -31,6 +31,7 @@ sub log {
my ($self, $level, $msg) = @_;
chomp $msg;
+ $level = substr($level, 0, 4);
my $time = $self->get_time();
diff --git a/src/PVE/HA/Sim/RTHardware.pm b/src/PVE/HA/Sim/RTHardware.pm
index 9528f542..d16582a3 100644
--- a/src/PVE/HA/Sim/RTHardware.pm
+++ b/src/PVE/HA/Sim/RTHardware.pm
@@ -65,6 +65,7 @@ sub log {
chomp $msg;
my $time = $self->get_time();
+ $level = substr($level, 0, 4);
$id = 'hardware' if !$id;
diff --git a/src/PVE/HA/Sim/TestHardware.pm b/src/PVE/HA/Sim/TestHardware.pm
index ebe6b546..0cedce7b 100644
--- a/src/PVE/HA/Sim/TestHardware.pm
+++ b/src/PVE/HA/Sim/TestHardware.pm
@@ -68,6 +68,7 @@ sub log {
chomp $msg;
my $time = $self->get_time();
+ $level = substr($level, 0, 4);
$id = 'hardware' if !$id;
--
2.47.3
next prev parent reply other threads:[~2026-04-17 12:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 12:27 [PATCH ha-manager 0/7] some test logging output improvements Daniel Kral
2026-04-17 12:27 ` Daniel Kral [this message]
2026-04-17 12:27 ` [PATCH ha-manager 2/7] consistently use correct priority levels for log calls Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 3/7] sim: hardware: factor common service lock hash access in unlock_service Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 4/7] use log with warning priority instead of warn where possible Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 5/7] pve-ha-tester: capture and fail for unexpected perl warnings Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 6/7] test: ha-tester: use consistent word casing for failed test messages Daniel Kral
2026-04-17 12:27 ` [PATCH ha-manager 7/7] test: ha-tester: use colorized diff for unexpected test log outputs Daniel Kral
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260417122728.330123-2-d.kral@proxmox.com \
--to=d.kral@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox