1. local function write_log(content)
    2. local file_name = "/tmp/debug.txt"
    3. content = content or "content as nil"
    4. local timestemp = os.date("%Y-%m-%d %H:%M:%S")
    5. content = timestemp .. " : " .. content
    6. local file = io.open(file_name, "a")
    7. if not file then
    8. return "can\'t open file \"" .. file_name .. "\""
    9. end
    10. file:write(debug.traceback(content,2))
    11. file:write("\n")
    12. file:close()
    13. return nil
    14. end