perl plugin: Remove the deprecated "plugin_flush_{all,one}" functions.
[collectd.git] / bindings / perl / lib / Collectd.pm
index 557950c..ca3b5d2 100644 (file)
@@ -116,6 +116,7 @@ my @fc_plugins : shared = ();
 my %cf_callbacks : shared = ();
 
 my %types = (
+       TYPE_CONFIG,   "config",
        TYPE_INIT,     "init",
        TYPE_READ,     "read",
        TYPE_WRITE,    "write",
@@ -135,6 +136,12 @@ my %fc_exec_names = (
        FC_TARGET, "invoke"
 );
 
+my %fc_cb_types = (
+       FC_CB_EXEC, "exec",
+       FC_CB_CREATE, "create",
+       FC_CB_DESTROY, "destroy"
+);
+
 foreach my $type (keys %types) {
        $plugins[$type] = &share ({});
 }
@@ -172,7 +179,9 @@ sub plugin_call_all {
        }
 
        if (TYPE_LOG != $type) {
-               DEBUG ("Collectd::plugin_call: type = \"$type\", args=\"@_\"");
+               DEBUG ("Collectd::plugin_call: type = \"$type\" ("
+                       . $types{$type} . "), args=\""
+                       . join(', ', map { defined($_) ? $_ : '<undef>' } @_) . "\"");
        }
 
        if (! defined $plugins[$type]) {
@@ -267,7 +276,8 @@ sub plugin_register {
        my $data = shift;
 
        DEBUG ("Collectd::plugin_register: "
-               . "type = \"$type\", name = \"$name\", data = \"$data\"");
+               . "type = \"$type\" (" . $types{$type}
+               . "), name = \"$name\", data = \"$data\"");
 
        if (! ((defined $type) && (defined $name) && (defined $data))) {
                ERROR ("Usage: Collectd::plugin_register (type, name, data)");
@@ -322,7 +332,8 @@ sub plugin_unregister {
        my $type = shift;
        my $name = shift;
 
-       DEBUG ("Collectd::plugin_unregister: type = \"$type\", name = \"$name\"");
+       DEBUG ("Collectd::plugin_unregister: type = \"$type\" ("
+               . $types{$type} . "), name = \"$name\"");
 
        if (! ((defined $type) && (defined $name))) {
                ERROR ("Usage: Collectd::plugin_unregister (type, name)");
@@ -454,35 +465,6 @@ sub plugin_flush {
        }
 }
 
-sub plugin_flush_one {
-       my $timeout = shift;
-       my $name    = shift;
-
-       WARNING ("Collectd::plugin_flush_one is deprecated - "
-               . "use Collectd::plugin_flush instead.");
-
-       if (! (defined ($timeout) && defined ($name))) {
-               ERROR ("Usage: Collectd::plugin_flush_one(timeout, name)");
-               return;
-       }
-
-       plugin_flush (plugins => $name, timeout => $timeout);
-}
-
-sub plugin_flush_all {
-       my $timeout = shift;
-
-       WARNING ("Collectd::plugin_flush_all is deprecated - "
-               . "use Collectd::plugin_flush instead.");
-
-       if (! defined ($timeout)) {
-               ERROR ("Usage: Collectd::plugin_flush_all(timeout)");
-               return;
-       }
-
-       plugin_flush (timeout => $timeout);
-}
-
 sub fc_call {
        my $type    = shift;
        my $name    = shift;
@@ -511,7 +493,9 @@ sub fc_call {
        }
 
        DEBUG ("Collectd::fc_call: "
-               . "type = \"$type\", name = \"$name\", cb_type = \"$cb_type\"");
+               . "type = \"$type\" (" . $fc_types{$type}
+               . "), name = \"$name\", cb_type = \"$cb_type\" ("
+               . $fc_cb_types{$cb_type} . ")");
 
        {
                lock %{$fc_plugins[$type]};
@@ -564,7 +548,8 @@ sub fc_register {
        my %fc : shared;
 
        DEBUG ("Collectd::fc_register: "
-               . "type = \"$type\", name = \"$name\", proc = \"$proc\"");
+               . "type = \"$type\" (" . $fc_types{$type}
+               . "), name = \"$name\", proc = \"$proc\"");
 
        if (! ((defined $type) && (defined $name) && (defined $proc))) {
                ERROR ("Usage: Collectd::fc_register(type, name, proc)");