--   This file is part of Reno desktop.
--
--  Reno desktop is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
--
--  Reno desktop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
--
--  You should have received a copy of the GNU General Public License along with Reno desktop. If not, see <https://www.gnu.org/licenses/>. 
-- 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
    
