Skip to content

Commit

Permalink
logging update
Browse files Browse the repository at this point in the history
  • Loading branch information
plally committed Sep 12, 2023
1 parent 855cfc1 commit fdbdfa9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lua/cfc_http_restrictions/shared/logging.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,17 @@ function CFCHTTP.LogRequest( input )
local msg = { COLORS.YELLOW, tostring( #input.urls ), " urls filtered:\n", COLORS.YELLOW, " ", input.fileLocation, "\n" }
for _, v in pairs( input.urls or {} ) do
local url = v.url
local reason = v.reason or ""
local reason = v.reason
local requestStatus = string.upper( v.status ) or "UNKNOWN"
local requestColor = statusColors[requestStatus] or COLORS.GREY
if reason then
reason = ": " .. reason
else
reason = ""
end

table.Add( msg,
{ requestColor, "\t", requestStatus, COLORS.GREY, ": ", COLORS.YELLOW, string.upper( input.method ), COLORS.GREY, " - ", COLORS.YELLOW, url, " : ", COLORS.WHITE, reason, "\n" } )
{ requestColor, "\t", requestStatus, COLORS.GREY, ": ", COLORS.YELLOW, string.upper( input.method ), COLORS.GREY, " - ", COLORS.YELLOW, url, COLORS.WHITE, reason, "\n" } )
end

MsgC( unpack( msg ) )
Expand Down

0 comments on commit fdbdfa9

Please sign in to comment.