plugin-loader: Add option to change log message if plugin is not found

Distributions like Debian/Ubuntu ship the plugins in multiple packages
that are not all installed by default.  When running tools like pki or
swanctl, which don't use modular loading with config snippets by default,
there are errors in the output if these packages and plugins are
currently not available.  In order to not alarm users, this change adds
a configure option that package maintainers can use.  It causes the log
level of the message to increase and also adds a note that mentions that
plugins are potentially available in other packages (which should be the
case unless the user tried to load a plugin, e.g. via load statement,
that is not actually built and shipped by the package maintainers).
This commit is contained in:
Tobias Brunner
2026-02-06 11:21:34 +01:00
parent 5b0d506215
commit dd7b0283ef
2 changed files with 10 additions and 0 deletions
@@ -477,8 +477,13 @@ static plugin_entry_t *load_plugin(private_plugin_loader_t *this, char *name,
{ /* try to load the plugin from a file */
break;
}
#ifndef PLUGINS_PACKAGED_SEPARATELY
DBG1(DBG_LIB, "plugin '%s': failed to load - %s not found and no "
"plugin file available", name, create);
#else
DBG2(DBG_LIB, "plugin '%s': failed to load - %s not found, plugin "
"may be shipped in a separate package", name, create);
#endif
/* fall-through */
default:
return NULL;