Commit 19402b1f7cf8122de9aacfc1b608f5c71b3ca180

Authored by dg
1 parent 17f61328

plop


git-svn-id: http://svn.net-core.org/repos/t-engine4@3962 51575b47-30f0-44d4-a5cc-537603b46e54
... ... @@ -44,6 +44,8 @@ function _M:init(x, y, w, h, max, fontname, fontsize, color, bgcolor)
44 44 setmetatable(self.cache, {__mode="v"})
45 45
46 46 self:resize(x, y, w, h)
  47 +
  48 +-- if config.settings.log_to_disk then self.out_f = fs.open("/game-log-"..(game and type(game) == "table" and game.__mod_info and game.__mod_info.short_name or "default").."-"..os.time()..".txt", "w") end
47 49 end
48 50
49 51 function _M:enableShadow(v)
... ... @@ -103,6 +105,7 @@ function _M:call(str, ...)
103 105 str = str:format(...)
104 106 print("[LOG]", str)
105 107 local tstr = str:toString()
  108 + if self.out_f then self.out_f:write(tstr:removeColorCodes()) self.out_f:write("\n") end
106 109 table.insert(self.log, 1, {str=tstr, timestamp = core.game.getTime()})
107 110 while #self.log > self.max_log do
108 111 local old = table.remove(self.log)
... ...