Skip to content

Commit

Permalink
Promote plugin loading issues to error logging level
Browse files Browse the repository at this point in the history
If plugin loading fails, provide diagnostic output about it on default
verbosity level. Also provide failure reason (for example unmet dynamic
symbol dependencies) as made available from g_module_error().
  • Loading branch information
spiiroin committed Dec 3, 2012
1 parent 5e19b90 commit 8014462
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mce-modules.c
Expand Up @@ -172,15 +172,17 @@ gboolean mce_modules_init(void)
GModule *module;
gchar *tmp = g_module_build_path(path, modlist[i]);

mce_log(LL_DEBUG,
mce_log(LL_INFO,
"Loading module: %s from %s",
modlist[i], path);

if ((module = g_module_open(tmp, 0)) != NULL) {
/* XXX: check dependencies, conflicts, et al */
modules = g_slist_prepend(modules, module);
} else {
mce_log(LL_DEBUG,
const char *err = g_module_error();
mce_log(LL_ERR, "%s", err ?: "unknown error");
mce_log(LL_ERR,
"Failed to load module: %s; skipping",
modlist[i]);
}
Expand Down

0 comments on commit 8014462

Please sign in to comment.