From: Sebastian Harl Date: Sat, 17 Nov 2007 17:41:08 +0000 (+0100) Subject: perl plugin: Removed logging calls from call_by_name(). X-Git-Tag: collectd-4.3.0beta0~95 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cad67e6fcbaf2cad7703ef4f83a92dbd87d44cde;p=collectd.git perl plugin: Removed logging calls from call_by_name(). The function might be called from a logging callback resulting in an infinite loop. Instead the error message is now saved in $@. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- diff --git a/src/perl.c b/src/perl.c index 4ae3cd1a..05e4b522 100644 --- a/src/perl.c +++ b/src/perl.c @@ -751,7 +751,7 @@ static XS (Collectd_call_by_name) char *name = NULL; if (NULL == (tmp = get_sv ("Collectd::cb_name", 0))) { - log_debug ("Collectd::call_by_name: cb_name is not set."); + sv_setpv (get_sv ("@", 1), "cb_name has not been set"); CLEAR_STACK_FRAME; return; } @@ -759,7 +759,7 @@ static XS (Collectd_call_by_name) name = SvPV_nolen (tmp); if (NULL == get_cv (name, 0)) { - log_err ("Collectd::call_by_name: Unknown callback \"%s\".", name); + sv_setpvf (get_sv ("@", 1), "unknown callback \"%s\"", name); CLEAR_STACK_FRAME; return; }