Simplified logging of list of loaded plugins.
This commit is contained in:
+4
-12
@@ -868,19 +868,11 @@ DBG_dump(const char *label, const void *p, size_t len)
|
||||
|
||||
static void show_loaded_plugins()
|
||||
{
|
||||
char buf[BUF_LEN];
|
||||
plugin_t *plugin;
|
||||
int len = 0;
|
||||
enumerator_t *enumerator;
|
||||
char *plugins;
|
||||
|
||||
buf[0] = '\0';
|
||||
enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
|
||||
while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin, NULL))
|
||||
{
|
||||
len += snprintf(&buf[len], BUF_LEN-len, "%s ", plugin->get_name(plugin));
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
whack_log(RC_COMMENT, "loaded plugins: %s", buf);
|
||||
plugins = lib->plugins->loaded_plugins(lib->plugins);
|
||||
whack_log(RC_COMMENT, "loaded plugins: %s", plugins);
|
||||
free(plugins);
|
||||
}
|
||||
|
||||
void show_status(bool all, const char *name)
|
||||
|
||||
+4
-12
@@ -269,19 +269,11 @@ options_t *options;
|
||||
*/
|
||||
static void print_plugins()
|
||||
{
|
||||
char buf[BUF_LEN];
|
||||
plugin_t *plugin;
|
||||
int len = 0;
|
||||
enumerator_t *enumerator;
|
||||
char *plugins;
|
||||
|
||||
buf[0] = '\0';
|
||||
enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
|
||||
while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin, NULL))
|
||||
{
|
||||
len += snprintf(&buf[len], BUF_LEN-len, "%s ", plugin->get_name(plugin));
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
DBG1(DBG_DMN, "loaded plugins: %s", buf);
|
||||
plugins = lib->plugins->loaded_plugins(lib->plugins);
|
||||
DBG1(DBG_DMN, "loaded plugins: %s", plugins);
|
||||
free(plugins);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
||||
Reference in New Issue
Block a user