if ddebuglog then
love.filesystem.write ("log", "Started")
end
local dlog = {}
local function logwrite (sign, message)
if ddebuglog then
local timestamp = os.date("%F-%R:%S")
local msgstring = string.format ("(%s) %s %s", sign, timestamp, message)
love.filesystem.append("log", msgstring)
end
end
function dlog.error (message)
logwrite("E", message)
end
function dlog.info (message)
logwrite("I", message)
end
dlog.info("Log init done.")
return dlog
love.filesystem.createDirectory(love.filesystem.getSaveDirectory())
ddebuglog = true
local dlog = require "debuglog"
dlog.info("hi")
function love.draw()
love.graphics.print("hi")
end
This particular line seems to be at fault; I checked the lua docs for the usage of os.date and it did not list %F or %R as legible arguments, which for a reason or another results in lua runtime to instantly hang up. I changed the line to something like the following, and there was no crashing.
On another note, you may want to handle the save directory differently, because as it stands the log file will be written in to a folder titled "conf" under %appdata%\LOVE, as opposed to "dlog" or something along those lines.
This particular line seems to be at fault; I checked the lua docs for the usage of os.date and it did not list %F or %R as legible arguments, which for a reason or another results in lua runtime to instantly hang up. I changed the line to something like the following, and there was no crashing.
On another note, you may want to handle the save directory differently, because as it stands the log file will be written in to a folder titled "conf" under %appdata%\LOVE, as opposed to "dlog" or something along those lines.
Another thanks, I forgot the "" in the conf.lua there is no warning if the identity is not a string.