OCaml: Only print log messages if DEBUG is set in the environment

Satisfies specification item A2
This commit is contained in:
Juno Takano 2025-04-21 20:10:59 -03:00
commit fab9c7140d
2 changed files with 12 additions and 9 deletions

View file

@ -1 +1,4 @@
let elog message = prerr_endline @@ " [log] " ^ message
let elog (message : string) : unit =
let debug_flag = try Unix.getenv "DEBUG" with Not_found -> "" in
if debug_flag <> "" then prerr_endline @@ " [log] " ^ message