webmcp
annotate framework/env/trace/request.lua @ 57:6a830c1479b0
Removed doubled "end" leading to parsing error
author | bsw |
---|---|
date | Sun Dec 18 22:14:03 2011 +0100 (2011-12-18) |
parents | 0bbfee4d4aed |
children |
rev | line source |
---|---|
jbe/bsw@0 | 1 --[[-- |
jbe/bsw@0 | 2 trace.request{ |
jbe/bsw@0 | 3 module = module, |
jbe/bsw@0 | 4 view = view, |
jbe/bsw@0 | 5 action = action |
jbe/bsw@0 | 6 } |
jbe/bsw@0 | 7 |
jbe/bsw@0 | 8 This function is called automatically to log which view or action has been requested by the web browser. |
jbe/bsw@0 | 9 |
jbe/bsw@0 | 10 --]]-- |
jbe/bsw@0 | 11 |
jbe/bsw@0 | 12 function trace.request(args) |
jbe@41 | 13 if not trace._disabled then |
jbe@41 | 14 local module = args.module |
jbe@41 | 15 local view = args.view |
jbe@41 | 16 local action = args.action |
jbe@41 | 17 if type(module) ~= "string" then |
jbe@41 | 18 error("No module string passed to trace.request{...}.") |
jbe@41 | 19 end |
jbe@41 | 20 if view and action then |
jbe@41 | 21 error("Both view and action passed to trace.request{...}.") |
jbe@41 | 22 end |
jbe@41 | 23 if not (view or action) then |
jbe@41 | 24 error("Neither view nor action passed to trace.request{...}.") |
jbe@41 | 25 end |
jbe@41 | 26 if view and type(view) ~= "string" then |
jbe@41 | 27 error("No view string passed to trace.request{...}.") |
jbe@41 | 28 end |
jbe@41 | 29 if action and type(action) ~= "string" then |
jbe@41 | 30 error("No action string passed to trace.request{...}.") |
jbe@41 | 31 end |
jbe@41 | 32 trace._new_entry{ |
jbe@41 | 33 type = "request", |
jbe@41 | 34 module = args.module, |
jbe@41 | 35 view = args.view, |
jbe@41 | 36 action = args.action |
jbe@41 | 37 } |
jbe/bsw@0 | 38 end |
jbe/bsw@0 | 39 end |