Browse Source

more debugging output

Cary Sandvig 25 years ago
parent
commit
04590b6432
1 changed files with 8 additions and 0 deletions
  1. 8 0
      panda/src/event/eventHandler.cxx

+ 8 - 0
panda/src/event/eventHandler.cxx

@@ -5,6 +5,7 @@
 
 #include "eventHandler.h"
 #include "eventQueue.h"
+#include "config_event.h"
 
 TypeHandle EventHandler::_type_handle;
 
@@ -52,6 +53,10 @@ dispatch_event(const CPT_Event &event) {
 
     Functions::const_iterator fi;
     for (fi = functions.begin(); fi != functions.end(); ++fi) {
+      if (event_cat->is_spam())
+	event_cat->spam() << "calling callback 0x" << (void*)(*fi)
+			  << " for event '" << event->get_name() << "'"
+			  << endl;
       (*fi)(event);
     }
   }
@@ -84,6 +89,9 @@ dispatch_event(const CPT_Event &event) {
 ////////////////////////////////////////////////////////////////////
 bool EventHandler::
 add_hook(const string &event_name, EventFunction *function) {
+  if (event_cat->is_debug())
+    event_cat->debug() << "adding hook for event '" << event_name
+		       << "' with function 0x" << (void*)function << endl;
   return _hooks[event_name].insert(function).second;
 }