The `trace()` function sets the execution trace level of the VM. Throws an exception if trace level argument is not a valid integer. Returns the previously used execution trace level. -- Testcase -- {% printf("Code before enabling tracing.\n"); trace(1); printf("Code after enabling tracing.\n"); trace(0); printf("Code after disabling tracing.\n"); %} -- End -- -- Expect stdout -- Code before enabling tracing. Code after enabling tracing. Code after disabling tracing. -- End -- -- Expect stderr -- [-2] 1 [-1] "function trace(...) { [native code] }" [+1] 0  [stdin]:4 trace(1); 0000001c POP [-1] 0 0000001d LVAR {0x0} ; "printf" [+1] "function printf(...) { [native code] }"  [stdin]:6 printf("Code after enabling tracing.\n"); 00000022 LOAD {0x3} ; "Code after enabling tracing.\n" [+2] "Code after enabling tracing.\n"  [stdin]:6 printf("Code after enabling tracing.\n"); 00000027 CALL {0x1} [*] CALLFRAME[1] |- stackframe 1/3 |- ctx null [-2] "Code after enabling tracing.\n" [-1] "function printf(...) { [native code] }" [+1] 29  [stdin]:6 printf("Code after enabling tracing.\n"); 0000002c POP [-1] 29 0000002d LVAR {0x2} ; "trace" [+1] "function trace(...) { [native code] }"  [stdin]:8 trace(0); 00000032 LOAD8 {0} [+2] 0  [stdin]:8 trace(0); 00000034 CALL {0x1} [*] CALLFRAME[1] |- stackframe 1/3 |- ctx null -- End -- Passing an invalid trace value throws an exception. -- Testcase -- {% trace("inval"); %} -- End -- -- Expect stderr -- Type error: Invalid level specified In line 2, byte 15: ` trace("inval");` Near here -------^ -- End --