perl plugin: Log the perl error messages if bootstrapping Collectd failed.
authorSebastian Harl <sh@tokkee.org>
Tue, 16 Sep 2008 13:36:18 +0000 (15:36 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Wed, 1 Oct 2008 07:47:37 +0000 (09:47 +0200)
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
src/perl.c

index 84dd537..2a8180d 100644 (file)
@@ -1481,7 +1481,9 @@ static int init_pi (int argc, char **argv)
        PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
 
        if (0 != perl_parse (aTHX_ xs_init, argc, argv, NULL)) {
-               log_err ("init_pi: Unable to bootstrap Collectd.");
+               SV *err = get_sv ("@", 1);
+               log_err ("init_pi: Unable to bootstrap Collectd: %s",
+                               SvPV_nolen (err));
 
                perl_destruct (perl_threads->head->interp);
                perl_free (perl_threads->head->interp);