[libpeas] Use plugin's module name in debug and warning messages
- From: Steve Frécinaux <sfre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Use plugin's module name in debug and warning messages
- Date: Wed, 23 Mar 2011 21:42:50 +0000 (UTC)
commit 486789aa68752f71feb8a78aa0ae0ddd19bbc78a
Author: Garrett Regier <alias301 gmail com>
Date: Mon Mar 21 10:15:45 2011 -0700
Use plugin's module name in debug and warning messages
libpeas/peas-engine.c | 13 +++++++------
loaders/c/peas-plugin-loader-c.c | 4 +---
loaders/python/peas-plugin-loader-python.c | 2 +-
tests/libpeas/engine.c | 4 ++--
4 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/libpeas/peas-engine.c b/libpeas/peas-engine.c
index fd3885b..5ed757a 100644
--- a/libpeas/peas-engine.c
+++ b/libpeas/peas-engine.c
@@ -778,7 +778,7 @@ load_plugin (PeasEngine *engine,
if (!dep_info)
{
g_warning ("Could not find plugin '%s' for plugin '%s'",
- dependencies[i], info->name);
+ dependencies[i], peas_plugin_info_get_module_name (info));
g_set_error (&info->error,
PEAS_PLUGIN_INFO_ERROR,
PEAS_PLUGIN_INFO_ERROR_DEP_NOT_FOUND,
@@ -793,7 +793,7 @@ load_plugin (PeasEngine *engine,
PEAS_PLUGIN_INFO_ERROR,
PEAS_PLUGIN_INFO_ERROR_LOADING_FAILED,
_("Dependency '%s' failed to load"),
- dep_info->name);
+ peas_plugin_info_get_name (dep_info));
goto error;
}
}
@@ -803,7 +803,7 @@ load_plugin (PeasEngine *engine,
if (loader == NULL)
{
g_warning ("Could not find loader '%s' for plugin '%s'",
- info->loader, info->name);
+ info->loader, peas_plugin_info_get_module_name (info));
g_set_error (&info->error,
PEAS_PLUGIN_INFO_ERROR,
PEAS_PLUGIN_INFO_ERROR_LOADER_NOT_FOUND,
@@ -814,7 +814,8 @@ load_plugin (PeasEngine *engine,
if (!peas_plugin_loader_load (loader, info))
{
- g_warning ("Error loading plugin '%s'", info->name);
+ g_warning ("Error loading plugin '%s'",
+ peas_plugin_info_get_module_name (info));
g_set_error (&info->error,
PEAS_PLUGIN_INFO_ERROR,
PEAS_PLUGIN_INFO_ERROR_LOADING_FAILED,
@@ -822,7 +823,7 @@ load_plugin (PeasEngine *engine,
goto error;
}
- g_debug ("Loaded plugin '%s'", info->module_name);
+ g_debug ("Loaded plugin '%s'", peas_plugin_info_get_module_name (info));
return TRUE;
@@ -906,7 +907,7 @@ peas_engine_unload_plugin_real (PeasEngine *engine,
peas_plugin_loader_garbage_collect (loader);
peas_plugin_loader_unload (loader, info);
- g_debug ("Unloaded plugin '%s'", info->module_name);
+ g_debug ("Unloaded plugin '%s'", peas_plugin_info_get_module_name (info));
if (!engine->priv->in_dispose)
g_object_notify (G_OBJECT (engine), "loaded-plugins");
diff --git a/loaders/c/peas-plugin-loader-c.c b/loaders/c/peas-plugin-loader-c.c
index 158cdb3..b4dfc82 100644
--- a/loaders/c/peas-plugin-loader-c.c
+++ b/loaders/c/peas-plugin-loader-c.c
@@ -72,9 +72,7 @@ peas_plugin_loader_c_load (PeasPluginLoader *loader,
if (!g_type_module_use (G_TYPE_MODULE (module)))
{
- g_warning ("Could not load plugin module: '%s'",
- peas_plugin_info_get_name (info));
-
+ g_warning ("Could not load plugin module: '%s'", module_name);
g_object_unref (module);
g_hash_table_remove (cloader->priv->loaded_plugins, module_name);
return FALSE;
diff --git a/loaders/python/peas-plugin-loader-python.c b/loaders/python/peas-plugin-loader-python.c
index ffecc14..7f8c6ce 100644
--- a/loaders/python/peas-plugin-loader-python.c
+++ b/loaders/python/peas-plugin-loader-python.c
@@ -217,7 +217,7 @@ peas_plugin_loader_python_load (PeasPluginLoader *loader,
{
g_warning ("Cannot load Python plugin '%s' since libpeas was "
"not able to initialize the Python interpreter",
- peas_plugin_info_get_name (info));
+ peas_plugin_info_get_modul_name (info));
return FALSE;
}
diff --git a/tests/libpeas/engine.c b/tests/libpeas/engine.c
index df45520..aa29409 100644
--- a/tests/libpeas/engine.c
+++ b/tests/libpeas/engine.c
@@ -225,8 +225,8 @@ test_engine_not_loadable_plugin (PeasEngine *engine)
testing_util_push_log_hook ("*libnot-loadable.so: cannot open shared "
"object file: No such file or directory");
- testing_util_push_log_hook ("Could not load plugin module: 'Not loadable'");
- testing_util_push_log_hook ("Error loading plugin 'Not loadable'");
+ testing_util_push_log_hook ("Could not load plugin module: 'not-loadable'");
+ testing_util_push_log_hook ("Error loading plugin 'not-loadable'");
info = peas_engine_get_plugin_info (engine, "not-loadable");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]