-- Error logging module
local loghandler = io.open(os.getenv("HOME").."/.awesome_errors","w")
local naughty = require("naughty")
if awesome.startup_errors then
    loghandler:write("[STARTUP] "..tostring(awesome.startup_errors).."\n")
    naughty.notify({title = "ERROR", text = tostring(awesome.startup_errors)})
end
do 
    local in_error = false
    awesome.connect_signal("debug::error", function(err)
        if in_error then return end
        in_error = true
        loghandler:write("[RUNTIME] "..tostring(err).."\n")
        naughty.notify({title = "ERROR", text = tostring(err)})
        in_error = false
    end)
end
    
