webmcp
annotate framework/env/trace/execution_return.lua @ 512:8579adac1cc6
Fixed demo-app configuration to match newer listen{...} parameterization
author | jbe |
---|---|
date | Mon Aug 21 05:40:09 2017 +0200 (2017-08-21) |
parents | 0bbfee4d4aed |
children |
rev | line source |
---|---|
jbe/bsw@0 | 1 --[[-- |
jbe/bsw@0 | 2 trace.execution_return{ |
jbe/bsw@0 | 3 status = status -- optional status |
jbe/bsw@0 | 4 } |
jbe/bsw@0 | 5 |
jbe/bsw@0 | 6 This function is called automatically when returning from a view, action, configuration or filter for logging purposes. |
jbe/bsw@0 | 7 |
jbe/bsw@0 | 8 --]]-- |
jbe/bsw@0 | 9 |
jbe/bsw@0 | 10 function trace.execution_return(args) |
jbe@41 | 11 if not trace._disabled then |
jbe@41 | 12 local status |
jbe@41 | 13 if args then |
jbe@41 | 14 status = args.status |
jbe@41 | 15 end |
jbe@41 | 16 if status and type(status) ~= "string" then |
jbe@41 | 17 error("Status passed to trace.execution_return{...} is not a string.") |
jbe@41 | 18 end |
jbe@41 | 19 local closed_section = trace._close_section() |
jbe@41 | 20 closed_section.status = status |
jbe/bsw@0 | 21 end |
jbe/bsw@0 | 22 end |