]> git.e2factory.org Git - e2factory.git/commitdiff
In tracer(), limit strings to 800 chars & make output less redundant
authorTobias Ulmer <tu@emlix.com>
Thu, 2 Aug 2012 15:31:25 +0000 (17:31 +0200)
committerTobias Ulmer <tu@emlix.com>
Thu, 2 Aug 2012 15:31:25 +0000 (17:31 +0200)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2lib.lua

index 7f6663217a4f7f4c319cd2d9ae67dd91bd5d528d..c7c4860148070888706bf746be60c5aea64aef5f 100644 (file)
@@ -336,8 +336,18 @@ function tracer(event, line)
       if lo > 1 then
         out = out .. ", "
       end
-      out = string.format("%s%s=\"%s\" (%s)", out, name, tostring(value),
-        type(value))
+
+      if type(value) == "string" then
+             local svalue = string.sub(value, 0, 800)
+             if string.len(value) > string.len(svalue) then
+                     svalue = svalue .. "..."
+             end
+
+             out = string.format("%s%s=\"%s\"", out, name, svalue)
+      else
+             out = string.format("%s%s=%s", out, name, tostring(value))
+      end
+
     end
     out = out .. ")"
     e2lib.log(4, out)