simple log library crashes love without notice
Posted: Sun Jun 10, 2018 9:00 am
Hi,
just getting started with love, but I have an error I don't know how to debug.
The game simply crashes without any errors. How can I debug this? What am I doing wrong?
Greetings
Karl
Here is the code of my lib debuglog.lua
main.lua
conf.lua
just getting started with love, but I have an error I don't know how to debug.
The game simply crashes without any errors. How can I debug this? What am I doing wrong?
Greetings
Karl
Here is the code of my lib debuglog.lua
Code: Select all
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
Code: Select all
love.filesystem.createDirectory(love.filesystem.getSaveDirectory())
ddebuglog = true
local dlog = require "debuglog"
dlog.info("hi")
function love.draw()
love.graphics.print("hi")
end
Code: Select all
function love.conf(t)
t.identity = logtest -- The name of the save directory (string)
t.console = true
end