EvandroLG / pegasus.lua

:rocket: Pegasus.lua is an http server to work with web applications written in Lua language.
http://evandrolg.github.io/pegasus.lua/
MIT License
418 stars 36 forks source link

chore: delete requests logs #148

Closed AMD-NICK closed 2 months ago

AMD-NICK commented 2 months ago

They were giving too many unnecessary messages. In my app I made custom logs and it was not nice when they were duplicated

Workaround, which I had to use to avoid duplicate logs:

print_ = print_ or print
function print(...)
    local val = tostring( select(1, ...) )
    if val:sub(1, 13) == "Request for: " then return end
    return print_(...)
end
Tieske commented 2 months ago

I'd love to see something like this added: https://github.com/Tieske/luamqtt/blob/main/mqtt/log.lua

It's a stub, but when needed can easily be replaced by the user loading LuaLogging, and then allows for decent logging. I mostly use it configured through enviornment variables: https://lunarmodules.github.io/lualogging/manual.html#environment