Skip to content

dump

dump(value) formats any Lua value into a readable string. Handles nested tables, quotes strings, and marks circular references as <cycle> instead of recursing forever.

dump(value)
sync
Param Type Description
value any The Lua value to format
Value Type Description
formatted string Human-readable representation of the value
function after_fetch(fetch_result, ctx)
-- deep_copy to avoid mutating the original fetch_result
local result = deep_copy(fetch_result)
if result.response then
-- strip the response body so dump doesn't flood the log with HTML
result.response.body = "-- stripped --"
end
print(dump(result)) -- logs to terminal
log(dump(result)) -- logs to hooks.log file
return fetch_result
end