]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Auth: Add debug logging to UeberBackend and BackendMakerClass 14174/head
authorFred Morcos <fred.morcos@open-xchange.com>
Wed, 15 May 2024 09:46:08 +0000 (11:46 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Wed, 15 May 2024 11:06:54 +0000 (13:06 +0200)
When trying to load backend module files.

pdns/dnsbackend.cc
pdns/ueberbackend.cc

index 1aca03ce484258e474076eda5222988e324e83aa..7abb7d47f39ebd9235755111f6d86fdb7caf1af6 100644 (file)
@@ -124,14 +124,22 @@ void BackendMakerClass::load(const string& module)
 {
   bool res = false;
 
+  g_log << Logger::Debug << "BackendMakerClass: module = " << module << endl;
+  g_log << Logger::Debug << "BackendMakerClass: module-dir = " << arg()["module-dir"] << endl;
   if (module.find('.') == string::npos) {
-    res = UeberBackend::loadmodule(arg()["module-dir"] + "/lib" + module + "backend.so");
+    auto modulePath = arg()["module-dir"] + "/lib" + module + "backend.so";
+    g_log << Logger::Debug << "BackendMakerClass: Loading '" << modulePath << "'" << endl;
+    res = UeberBackend::loadmodule(modulePath);
   }
-  else if (module[0] == '/' || (module[0] == '.' && module[1] == '/') || (module[0] == '.' && module[1] == '.')) { // absolute or current path
+  else if (module[0] == '/' || (module[0] == '.' && module[1] == '/') || (module[0] == '.' && module[1] == '.')) {
+    // Absolute path, Current path or Parent path
+    g_log << Logger::Debug << "BackendMakerClass: Loading '" << module << "'" << endl;
     res = UeberBackend::loadmodule(module);
   }
   else {
-    res = UeberBackend::loadmodule(arg()["module-dir"] + "/" + module);
+    auto modulePath = arg()["module-dir"] + "/" + module;
+    g_log << Logger::Debug << "BackendMakerClass: Loading '" << modulePath << "'" << endl;
+    res = UeberBackend::loadmodule(modulePath);
   }
 
   if (!res) {
index 1d9950fb79ccab5b281891d681df7fe98e9006e8..e52f07efb120aa1978284b4451e533406c5b3189 100644 (file)
@@ -76,24 +76,31 @@ bool UeberBackend::loadmodule(const string& name)
 
 bool UeberBackend::loadModules(const vector<string>& modules, const string& path)
 {
+  g_log << Logger::Debug << "UeberBackend: path = " << path << endl;
+
   for (const auto& module : modules) {
     bool res = false;
 
+    g_log << Logger::Debug << "UeberBackend: Attempting to load module '" << module << "'" << endl;
+
     if (module.find('.') == string::npos) {
       auto fullPath = path;
       fullPath += "/lib";
       fullPath += module;
       fullPath += "backend.so";
+      g_log << Logger::Debug << "UeberBackend: Loading '" << fullPath << "'" << endl;
       res = UeberBackend::loadmodule(fullPath);
     }
     else if (module[0] == '/' || (module[0] == '.' && module[1] == '/') || (module[0] == '.' && module[1] == '.')) {
-      // absolute or current path
+      // Absolute path, Current path or Parent path
+      g_log << Logger::Debug << "UeberBackend: Loading '" << module << "'" << endl;
       res = UeberBackend::loadmodule(module);
     }
     else {
       auto fullPath = path;
       fullPath += "/";
       fullPath += module;
+      g_log << Logger::Debug << "UeberBackend: Loading '" << fullPath << "'" << endl;
       res = UeberBackend::loadmodule(fullPath);
     }