From fdbdfa96db71658635a65e410fad63241999e2a6 Mon Sep 17 00:00:00 2001 From: Pierce Date: Tue, 12 Sep 2023 18:58:10 -0400 Subject: [PATCH] logging update --- lua/cfc_http_restrictions/shared/logging.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lua/cfc_http_restrictions/shared/logging.lua b/lua/cfc_http_restrictions/shared/logging.lua index 0efff3a..f74002c 100644 --- a/lua/cfc_http_restrictions/shared/logging.lua +++ b/lua/cfc_http_restrictions/shared/logging.lua @@ -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 ) )