jbe/bsw@0: --[[-- jbe/bsw@0: trace.request{ jbe/bsw@0: module = module, jbe/bsw@0: view = view, jbe/bsw@0: action = action jbe/bsw@0: } jbe/bsw@0: jbe/bsw@0: This function is called automatically to log which view or action has been requested by the web browser. jbe/bsw@0: jbe/bsw@0: --]]-- jbe/bsw@0: jbe/bsw@0: function trace.request(args) jbe@41: if not trace._disabled then jbe@41: local module = args.module jbe@41: local view = args.view jbe@41: local action = args.action jbe@41: if type(module) ~= "string" then jbe@41: error("No module string passed to trace.request{...}.") jbe@41: end jbe@41: if view and action then jbe@41: error("Both view and action passed to trace.request{...}.") jbe@41: end jbe@41: if not (view or action) then jbe@41: error("Neither view nor action passed to trace.request{...}.") jbe@41: end jbe@41: if view and type(view) ~= "string" then jbe@41: error("No view string passed to trace.request{...}.") jbe@41: end jbe@41: if action and type(action) ~= "string" then jbe@41: error("No action string passed to trace.request{...}.") jbe@41: end jbe@41: trace._new_entry{ jbe@41: type = "request", jbe@41: module = args.module, jbe@41: view = args.view, jbe@41: action = args.action jbe@41: } jbe/bsw@0: end jbe/bsw@0: end