webmcp
diff framework/env/trace/enter_view.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 |
line diff
1.1 --- a/framework/env/trace/enter_view.lua Sat Oct 16 17:49:11 2010 +0200 1.2 +++ b/framework/env/trace/enter_view.lua Sat Oct 16 17:51:18 2010 +0200 1.3 @@ -9,13 +9,15 @@ 1.4 --]]-- 1.5 1.6 function trace.enter_view(args) 1.7 - local module = args.module 1.8 - local view = args.view 1.9 - if type(module) ~= "string" then 1.10 - error("No module passed to trace.enter_view{...}.") 1.11 + if not trace._disabled then 1.12 + local module = args.module 1.13 + local view = args.view 1.14 + if type(module) ~= "string" then 1.15 + error("No module passed to trace.enter_view{...}.") 1.16 + end 1.17 + if type(view) ~= "string" then 1.18 + error("No view passed to trace.enter_view{...}.") 1.19 + end 1.20 + trace._open_section{ type = "view", module = module, view = view } 1.21 end 1.22 - if type(view) ~= "string" then 1.23 - error("No view passed to trace.enter_view{...}.") 1.24 - end 1.25 - trace._open_section{ type = "view", module = module, view = view } 1.26 end