summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ocaml_rts/sail_lib.ml11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/ocaml_rts/sail_lib.ml b/lib/ocaml_rts/sail_lib.ml
index 5f83b9c2..a0ba31eb 100644
--- a/lib/ocaml_rts/sail_lib.ml
+++ b/lib/ocaml_rts/sail_lib.ml
@@ -2,6 +2,8 @@ open Big_int
type 'a return = { return : 'b . 'a -> 'b }
+let opt_trace = ref false
+
let trace_depth = ref 0
let random = ref false
@@ -15,8 +17,13 @@ let sail_call (type t) (f : _ -> t) =
with M.Return x -> x
let trace str =
- if !trace_depth < 0 then trace_depth := 0 else ();
- prerr_endline (String.make (!trace_depth * 2) ' ' ^ str)
+ if !opt_trace
+ then
+ begin
+ if !trace_depth < 0 then trace_depth := 0 else ();
+ prerr_endline (String.make (!trace_depth * 2) ' ' ^ str)
+ end
+ else ()
let trace_write name str =
trace ("Write: " ^ name ^ " " ^ str)