Przeglądaj źródła

Add debug print to lua_preload example file

bel2125 7 lat temu
rodzic
commit
3a84b59572
1 zmienionych plików z 12 dodań i 1 usunięć
  1. 12 1
      test/preload.lua

+ 12 - 1
test/preload.lua

@@ -69,9 +69,20 @@ SAPI.Response.write = function(...)
 end
 
 
+-- Debug helper function to print a table
+function po(t)
+  print("Type: " .. type(t) .. ", Value: " .. tostring(t))
+  if type(t)=="table" then
+    for k,v in pairs(t) do
+      print(k,v)
+    end
+  end
+end
+
 -----------------------------------------------------
 
 
 -- Use cgilua interface
-require "cgilua"
+-- require "cgilua"
+