webmcp
annotate framework/env/trace/execution_return.lua @ 41:0bbfee4d4aed
New functions trace.disable() and trace.is_disabled()
author | jbe |
---|---|
date | Sat Oct 16 17:51:18 2010 +0200 (2010-10-16) |
parents | 9fdfb27f8e67 |
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 |