Mercurial Hosting > chat
comparison src/error_log.js.luan @ 3:2c63b10781e1
add login
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Thu, 24 Oct 2024 21:43:44 -0600 |
| parents | |
| children | 5240c054dcd4 |
comparison
equal
deleted
inserted
replaced
| 2:ee1f91e67509 | 3:2c63b10781e1 |
|---|---|
| 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 Http = require "luan:http/Http.luan" | |
| 8 local Logging = require "luan:logging/Logging.luan" | |
| 9 local logger = Logging.logger "error_log.js" | |
| 10 | |
| 11 | |
| 12 local function priority(err) | |
| 13 return "error" | |
| 14 end | |
| 15 | |
| 16 return function() | |
| 17 local err = Http.request.parameters.err | |
| 18 if err == nil then | |
| 19 return -- stupid bots | |
| 20 end | |
| 21 local call = priority(err) | |
| 22 logger[call](trim(err).."\n"..trim(Http.request.raw_head).."\n") | |
| 23 end |
