Mercurial Hosting > disearch
annotate src/error_log.js.luan @ 10:ae9ebeb1c246
more links
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 27 Oct 2023 16:20:45 -0600 |
parents | 8896ffd7b152 |
children | 3e2cb946d511 |
rev | line source |
---|---|
4 | 1 local Luan = require "luan:Luan.luan" |
2 local error = Luan.error | |
3 local Http = require "luan:http/Http.luan" | |
4 local Logging = require "luan:logging/Logging.luan" | |
5 local logger = Logging.logger "error_log.js" | |
6 | |
7 | |
8 local function priority(err) | |
9 return "error" | |
10 end | |
11 | |
12 return function() | |
13 local err = Http.request.parameters.err | |
14 if err == nil then | |
15 return -- stupid bots | |
16 end | |
17 local call = priority(err) | |
18 logger[call](trim(err).."\n"..trim(Http.request.raw_head).."\n") | |
19 end |