Skip to content

Logging

Seppi edited this page Apr 26, 2016 · 1 revision

To change the way logging works, monkey patch log.

For example, to print the log to a file instead of standard out:

lovernetlib = require "lovernet"

log = function(...)
  local args = {...} -- pull in all args
  local _self = table.remove(args,1) -- remove self object
  love.filesystem.append("log.txt",table.concat(args,"\t").."\n")
end

lovernet = lovernetlib.new{log=log}

Clone this wiki locally