Advertisement
alestane

thorough debug trace

Apr 18th, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.31 KB | None | 0 0
  1. *** WARNING: UNTESTED CODE ***
  2.  
  3. do
  4.     local errorLog = io.open(system.pathForFile("error.log", DocumentsDirectory), 'w')
  5.     if errorLog then
  6.         local function recordLine(event, line)
  7.             errorLog:write(debug.getinfo(2).source, ": ", line, '\n')
  8.             errorLog:flush()
  9.         end
  10.         debug.sethook(recordLine, 'l')
  11.     end
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement