More verbose messages on plugin loading.

This commit is contained in:
Matthias Koefferlein 2018-07-29 02:36:25 +02:00
parent 76db5d1714
commit 11627486d6
2 changed files with 8 additions and 3 deletions

View File

@ -53,6 +53,8 @@ static PluginDescriptor load_plugin (const std::string &pp)
PluginDescriptor desc;
desc.path = pp;
tl::log << tl::sprintf (tl::to_string (tr ("Loading plugin: %s")), pp);
dbp_init_func_t init_func = 0;
static const char *init_func_name = "dbp_init";
@ -90,7 +92,6 @@ static PluginDescriptor load_plugin (const std::string &pp)
}
}
tl::log << tl::sprintf (tl::to_string (tr ("Loaded plugin: %s")), pp);
return desc;
}
@ -122,6 +123,7 @@ get_module_path ()
if (dladdr ((void *) &init, &info)) {
return tl::absolute_file_path (tl::to_string_from_local (info.dli_fname));
} else {
tl::warn << tl::to_string (tr ("Unable to get path of db library (as basis for loading db_plugins)"));
return std::string ();
}
@ -140,6 +142,7 @@ void init (const std::vector<std::string> &_paths)
if (paths.empty ()) {
// nothing to do
tl::log << tl::to_string (tr ("No db_plugins loaded - no path given"));
return;
}

View File

@ -25,6 +25,7 @@
#include "tlException.h"
#include "tlLog.h"
#include "tlString.h"
#include "tlFileUtils.h"
#ifdef _WIN32
# include <windows.h>
@ -121,9 +122,9 @@ get_module_path ()
Dl_info info = { };
if (dladdr ((void *) &init, &info)) {
QFileInfo fi (QString::fromLocal8Bit (info.dli_fname));
return tl::to_string (fi.absolutePath ());
return tl::absolute_file_path (tl::to_string_from_local (info.dli_fname));
} else {
tl::warn << tl::to_string (tr ("Unable to get path of lay library (as basis for loading lay_plugins)"));
return std::string ();
}
@ -142,6 +143,7 @@ void init (const std::vector<std::string> &_paths)
if (paths.empty ()) {
// nothing to do
tl::log << tl::to_string (tr ("No lay_plugins loaded - no path given"));
return;
}