diff --git a/sources/shiboken6/libshiboken/basewrapper.cpp b/sources/shiboken6/libshiboken/basewrapper.cpp
index 0070af672..d60db5239 100644
--- a/sources/shiboken6/libshiboken/basewrapper.cpp
+++ b/sources/shiboken6/libshiboken/basewrapper.cpp
@@ -60,6 +60,9 @@
 #include "voidptr.h"
 
 #include <iostream>
+#include <fstream>
+
+#include <stdlib.h>
 
 #if defined(__APPLE__)
 #include <dlfcn.h>
@@ -78,6 +81,9 @@ static void callDestructor(const Shiboken::DtorAccumulatorVisitor::DestructorEnt
     }
 }
 
+static bool verb = std::getenv("VERBOSE");
+static const char *logF = "log.txt";
+
 extern "C"
 {
 
@@ -967,6 +973,14 @@ PyTypeObject *typeForTypeName(const char *typeName)
         if (PyTypeObject *pyType = Shiboken::Conversions::getPythonTypeObject(typeName))
             result = pyType;
     }
+    if (verb) {
+        std::ofstream f(logF, std::ios::app);
+        f << __FUNCTION__ << ' ' << typeName << " rets " << result << ' ';
+        if (result)
+            f << result->tp_name;
+        f << '\n';
+    }
+
     return result;
 }
 
@@ -1352,6 +1366,12 @@ PyObject *newObject(PyTypeObject *instanceType,
                     bool isExactType,
                     const char *typeName)
 {
+    if (verb) {
+        std::ofstream f(logF, std::ios::app);
+        f << __FUNCTION__ << ' ' << instanceType->tp_name
+                  << ' ' << cptr<< " exact=" << isExactType
+                  << " typeName="  << typeName << '\n';
+    }
     // Try to find the exact type of cptr.
     if (!isExactType) {
         if (PyTypeObject *exactType = ObjectType::typeForTypeName(typeName))
diff --git a/sources/shiboken6/libshiboken/bindingmanager.cpp b/sources/shiboken6/libshiboken/bindingmanager.cpp
index 2d4583495..5065c6239 100644
--- a/sources/shiboken6/libshiboken/bindingmanager.cpp
+++ b/sources/shiboken6/libshiboken/bindingmanager.cpp
@@ -49,8 +49,12 @@
 
 #include <cstddef>
 #include <fstream>
+#include <iostream>
 #include <unordered_map>
 
+static const bool verb = std::getenv("VERBOSE");
+static const char *logF = "log.txt";
+
 namespace Shiboken
 {
 
@@ -94,19 +98,43 @@ public:
     PyTypeObject *identifyType(void **cptr, PyTypeObject *type, PyTypeObject *baseType) const
     {
         auto edgesIt = m_edges.find(type);
+        if (verb) {
+            std::ofstream f(logF, std::ios::app);
+            f << '>' << __FUNCTION__ << ' ' << type->tp_name
+              <<  ' ' << baseType->tp_name <<" found=" << (edgesIt != m_edges.end()) << '\n';
+        }
+
         if (edgesIt != m_edges.end()) {
             const NodeList &adjNodes = m_edges.find(type)->second;
             for (PyTypeObject *node : adjNodes) {
+                if (verb) {
+                    std::ofstream f(logF, std::ios::app);
+                    f << __FUNCTION__ << " looping node" << node->tp_name << " of " << adjNodes.size() << '\n';
+                }
                 PyTypeObject *newType = identifyType(cptr, node, baseType);
-                if (newType)
+                if (newType) {
+                    if (verb) {
+                        std::ofstream f(logF, std::ios::app);
+                        f << __FUNCTION__ << " node/ident=" <<  newType->tp_name << '\n';
+                    }
                     return newType;
+                }
             }
         }
         void *typeFound = nullptr;
         auto *sotp = PepType_SOTP(type);
+        if (verb) {
+            std::ofstream f(logF, std::ios::app);
+            f << __FUNCTION__ << " sotp=" << sotp->original_name << " discf=" << sotp->type_discovery << '\n';
+        }
         if (sotp->type_discovery)
             typeFound = sotp->type_discovery(*cptr, baseType);
         if (typeFound) {
+            if (verb) {
+                std::ofstream f(logF, std::ios::app);
+                f << __FUNCTION__ << " typeFound via discovery\n";
+            }
+
             // This "typeFound != type" is needed for backwards compatibility with old modules using a newer version of
             // libshiboken because old versions of type_discovery function used to return a PyTypeObject *instead of
             // a possible variation of the C++ instance pointer (*cptr).
@@ -370,6 +398,10 @@ void BindingManager::addClassInheritance(PyTypeObject *parent, PyTypeObject *chi
 
 PyTypeObject *BindingManager::resolveType(void **cptr, PyTypeObject *type)
 {
+    if (verb) {
+        std::ofstream f(logF, std::ios::app);
+        f << __FUNCTION__ << " ident=" << type->tp_name << '\n';
+    }
     PyTypeObject *identifiedType = m_d->classHierarchy.identifyType(cptr, type, type);
     return identifiedType ? identifiedType : type;
 }
