package codept-lib

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file debug.ml

1
2
3
4
5
6
7
8
9
10
11
12
let debug fmt =
  let pf = match Sys.getenv "CODEPT_DEBUG" with
    | "1" | "true" -> Format.fprintf
    | _ -> Format.ifprintf
    | exception Not_found -> Format.ifprintf in
  pf Pp.err ("Debug:" ^^ fmt ^^"@.")

let debug_callstack () =
  match Sys.getenv "CODEPT_DEBUG" with
  | "1" | "true" ->
    Printexc.print_raw_backtrace stderr (Printexc.get_callstack 10_000_000)
  | _ -> ()
OCaml

Innovation. Community. Security.