Mercurial Hosting > lang
comparison src/error_log.js.luan @ 1:1c87f785eb42
start chat
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 08 Jul 2025 14:18:25 -0600 |
parents | |
children | 3d9903900a71 |
comparison
equal
deleted
inserted
replaced
0:9845dcb9f5fc | 1:1c87f785eb42 |
---|---|
1 local Luan = require "luan:Luan.luan" | |
2 local error = Luan.error | |
3 local String = require "luan:String.luan" | |
4 local trim = String.trim or error() | |
5 local regex = String.regex or error() | |
6 local contains = String.contains or error() | |
7 local Table = require "luan:Table.luan" | |
8 local concat = Table.concat or error() | |
9 local Http = require "luan:http/Http.luan" | |
10 local Logging = require "luan:logging/Logging.luan" | |
11 local logger = Logging.logger "error_log.js" | |
12 | |
13 | |
14 | |
15 local function priority(err) | |
16 return "error" | |
17 end | |
18 | |
19 return function() | |
20 local err = Http.request.parameters.err | |
21 if err == nil then | |
22 return -- stupid bots | |
23 end | |
24 local call = priority(err) | |
25 logger[call](trim(err).."\n"..trim(Http.request.raw_head).."\n") | |
26 end |