view src/error_log.js.luan @ 17:74277b56ac3c

home page
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 01 Nov 2023 21:11:25 -0600
parents 3e2cb946d511
children
line wrap: on
line source

local Luan = require "luan:Luan.luan"
local error = Luan.error
local String = require "luan:String.luan"
local trim = String.trim or error()
local Http = require "luan:http/Http.luan"
local Logging = require "luan:logging/Logging.luan"
local logger = Logging.logger "error_log.js"


local function priority(err)
	return "error"
end

return function()
	local err = Http.request.parameters.err
	if err == nil then
		return  -- stupid bots
	end
	local call = priority(err)
	logger[call](trim(err).."\n"..trim(Http.request.raw_head).."\n")
end