Simplified logging of list of loaded plugins.
This commit is contained in:
+4
-13
@@ -206,20 +206,11 @@ METHOD(daemon_t, start, void,
|
||||
*/
|
||||
static void print_plugins()
|
||||
{
|
||||
char buf[512];
|
||||
int len = 0;
|
||||
enumerator_t *enumerator;
|
||||
plugin_t *plugin;
|
||||
char *plugins;
|
||||
|
||||
buf[0] = '\0';
|
||||
enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
|
||||
while (len < sizeof(buf) && enumerator->enumerate(enumerator, &plugin, NULL))
|
||||
{
|
||||
len += snprintf(&buf[len], sizeof(buf)-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);
|
||||
}
|
||||
|
||||
METHOD(daemon_t, initialize, bool,
|
||||
|
||||
@@ -415,7 +415,7 @@ METHOD(stroke_list_t, status, void,
|
||||
{
|
||||
peer_cfg_t *peer_cfg;
|
||||
plugin_t *plugin;
|
||||
char *pool;
|
||||
char *pool, *plugins;
|
||||
host_t *host;
|
||||
u_int32_t dpd;
|
||||
time_t since, now;
|
||||
@@ -449,14 +449,9 @@ METHOD(stroke_list_t, status, void,
|
||||
}
|
||||
fprintf(out, ", scheduled: %d\n",
|
||||
lib->scheduler->get_job_load(lib->scheduler));
|
||||
fprintf(out, " loaded plugins: ");
|
||||
enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
|
||||
while (enumerator->enumerate(enumerator, &plugin, NULL))
|
||||
{
|
||||
fprintf(out, "%s ", plugin->get_name(plugin));
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
fprintf(out, "\n");
|
||||
plugins = lib->plugins->loaded_plugins(lib->plugins);
|
||||
fprintf(out, " loaded plugins: %s\n", plugins);
|
||||
free(plugins);
|
||||
|
||||
first = TRUE;
|
||||
enumerator = this->attribute->create_pool_enumerator(this->attribute);
|
||||
|
||||
+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)
|
||||
|
||||
@@ -280,18 +280,11 @@ usage(const char *message)
|
||||
*/
|
||||
static void print_plugins()
|
||||
{
|
||||
char buf[BUF_LEN];
|
||||
plugin_t *plugin;
|
||||
int len = 0;
|
||||
enumerator_t *enumerator;
|
||||
char *plugins;
|
||||
|
||||
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_LIB, " loaded plugins: %s", buf);
|
||||
plugins = lib->plugins->loaded_plugins(lib->plugins);
|
||||
DBG1(DBG_LIB, " loaded plugins: %s", plugins);
|
||||
free(plugins);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user