diff --git a/include/villas/node_type.h b/include/villas/node_type.h index d0dcdc8d1..2beef8e85 100644 --- a/include/villas/node_type.h +++ b/include/villas/node_type.h @@ -157,4 +157,7 @@ int node_type_start(struct node_type *vt, struct super_node *sn); */ int node_type_stop(struct node_type *vt); +/** Return a printable representation of the node-type. */ +char * node_type_name(struct node_type *vt); + /** @} */ \ No newline at end of file diff --git a/lib/node_type.c b/lib/node_type.c index b4fb095e4..92a26c851 100644 --- a/lib/node_type.c +++ b/lib/node_type.c @@ -36,7 +36,7 @@ int node_type_start(struct node_type *vt, struct super_node *sn) if (vt->state != STATE_DESTROYED) return 0; - info("Initializing " YEL("%s") " node type which is used by %zu nodes", plugin_name(vt), list_length(&vt->instances)); + info("Initializing " YEL("%s") " node type which is used by %zu nodes", node_type_name(vt), list_length(&vt->instances)); { INDENT ret = vt->init ? vt->init(sn) : 0; } @@ -54,7 +54,7 @@ int node_type_stop(struct node_type *vt) if (vt->state != STATE_STARTED) return 0; - info("De-initializing " YEL("%s") " node type", plugin_name(vt)); + info("De-initializing " YEL("%s") " node type", node_type_name(vt)); { INDENT ret = vt->deinit ? vt->deinit() : 0; } @@ -64,3 +64,8 @@ int node_type_stop(struct node_type *vt) return ret; } + +char * node_type_name(struct node_type *vt) +{ + return plugin_name(vt); +} \ No newline at end of file diff --git a/src/pipe.c b/src/pipe.c index 074fb5106..97557f527 100644 --- a/src/pipe.c +++ b/src/pipe.c @@ -253,7 +253,7 @@ int main(int argc, char *argv[]) ret = node_type_start(node->_vt, &sn); if (ret) - error("Failed to intialize node type: %s", node_name(node)); + error("Failed to intialize node type: %s", node_type_name(node->_vt)); ret = node_check(node); if (ret)