[pve-devel] [RFC ha-manager 1/3] Env: allow debug logging

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Apr 26 10:55:27 CEST 2016


this can be helpful if someone wants to quickly add debug output for
a real world or simulator test, witout touching the regression tests

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/PVE/HA/Env/PVE2.pm    | 2 ++
 src/PVE/HA/Sim/TestEnv.pm | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/PVE/HA/Env/PVE2.pm b/src/PVE/HA/Env/PVE2.pm
index 37823ee..03129c8 100644
--- a/src/PVE/HA/Env/PVE2.pm
+++ b/src/PVE/HA/Env/PVE2.pm
@@ -223,6 +223,8 @@ sub log {
 
     chomp $msg;
 
+    $level = 'warning' if $level eq 'debug';
+
     syslog($level, $msg);
 }
 
diff --git a/src/PVE/HA/Sim/TestEnv.pm b/src/PVE/HA/Sim/TestEnv.pm
index ceec2a5..93aeede 100644
--- a/src/PVE/HA/Sim/TestEnv.pm
+++ b/src/PVE/HA/Sim/TestEnv.pm
@@ -39,6 +39,8 @@ sub get_time {
 sub log {
     my ($self, $level, $msg) = @_;
 
+    return if $level eq 'debug';
+
     chomp $msg;
 
     my $time = $self->get_time();
-- 
2.1.4





More information about the pve-devel mailing list