Pārlūkot izejas kodu

Simplify debug logging - fix string escaping issues

Luis Rosales 2 mēneši atpakaļ
vecāks
revīzija
4b07fc074e
1 mainītis faili ar 3 papildinājumiem un 5 dzēšanām
  1. 3 5
      package/src/client2server-unified.lua

+ 3 - 5
package/src/client2server-unified.lua

@@ -109,7 +109,7 @@ local function log_recv(data)
     if cfg.debug then
         local s = data:gsub("\"", "\\"")
         if #s > 200 then s = s:sub(1, 200) .. "..." end
-        log("debug", "RECV: " .. s)
+        log("debug", "RECV data")
     end
 end
 
@@ -302,8 +302,7 @@ end
 
 function ws.send(data)
     if cfg.debug then
-        local s = #data > 150 and data:sub(1,150).."..." or data
-        log("debug", "SEND: " .. s)
+        log("debug", "SEND data")
     end
     if not ws.connected then buffer.add(data); return false end
 
@@ -338,8 +337,7 @@ function ws.recv()
     end
 
     if cfg.debug and data then
-        local s = #data > 150 and data:sub(1,150).."..." or data
-        log("debug", "RECV: " .. s)
+        log("debug", "RECV data")
     end
 
     return data