Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[debug] configurable output function (default to stdout to keep in sy…

…nc with log output)
  • Loading branch information...
commit 886bd5fcbe8194bbb525907f249cacd5abf184cd 1 parent a6e0603
@avsm authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  syntax/pa_trace.ml
View
3  syntax/pa_trace.ml
@@ -30,6 +30,7 @@
open Camlp4.PreCast
let filter_std = true
+let output_fn = "print_endline"
type col = Blue | Green | Cyan | Red
let code_of_col = function |Blue -> 34 |Green -> 32 |Cyan -> 36 |Red -> 31
@@ -51,7 +52,7 @@ let add_debug_expr name e =
let _loc = Ast.loc_of_expr e in
match color_log _loc name with
|None -> <:expr< $e$ >>
- |Some m -> <:expr< prerr_endline $str:m$; $e$ >>
+ |Some m -> <:expr< $lid:output_fn$ $str:m$; $e$ >>
let rec map_match_case name = function
| <:match_case@_loc< $m1$ | $m2$ >> ->
Please sign in to comment.
Something went wrong with that request. Please try again.