[pve-devel] [PATCH guest-common 2/2] vzdump: add common log sub-method

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Dec 14 07:58:36 CET 2017


Add a general log method here which supports to pass on the "log to
syslog too" functionality and makes it more clear what each
parameter of logerr and logginfo means.

Further, we can now also log wlith a 'warn' level, which can be
useful to notice an backup user of a possible problem which isn't a
error per se, but may need the users attention.

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---

Found those sitting around, they are pre work for addressing parts
of the #1468 RFE

 PVE/VZDump/Plugin.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/PVE/VZDump/Plugin.pm b/PVE/VZDump/Plugin.pm
index 9e8a76f..9933ef6 100644
--- a/PVE/VZDump/Plugin.pm
+++ b/PVE/VZDump/Plugin.pm
@@ -60,6 +60,12 @@ sub cmd_noerr {
     return $res;
 }
 
+sub log {
+    my ($self, $level, $msg, $to_syslog) = @_;
+
+    debugmsg($level, $msg, $self->{logfd}, $to_syslog);
+}
+
 sub loginfo {
     my ($self, $msg) = @_;
 
-- 
2.11.0





More information about the pve-devel mailing list