From 11627486d6affa82af3a7b2a1b19b6235d9028fd Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 29 Jul 2018 02:36:25 +0200 Subject: [PATCH] More verbose messages on plugin loading. --- src/db/db/dbInit.cc | 5 ++++- src/lay/lay/layInit.cc | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/db/db/dbInit.cc b/src/db/db/dbInit.cc index ec0879079..ff8556ed5 100644 --- a/src/db/db/dbInit.cc +++ b/src/db/db/dbInit.cc @@ -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 &_paths) if (paths.empty ()) { // nothing to do + tl::log << tl::to_string (tr ("No db_plugins loaded - no path given")); return; } diff --git a/src/lay/lay/layInit.cc b/src/lay/lay/layInit.cc index fbdaa7c73..2a6561728 100644 --- a/src/lay/lay/layInit.cc +++ b/src/lay/lay/layInit.cc @@ -25,6 +25,7 @@ #include "tlException.h" #include "tlLog.h" #include "tlString.h" +#include "tlFileUtils.h" #ifdef _WIN32 # include @@ -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 &_paths) if (paths.empty ()) { // nothing to do + tl::log << tl::to_string (tr ("No lay_plugins loaded - no path given")); return; }