this repo has no description
1type log_dest =
2 [ `Compile
3 | `Compile_src
4 | `Link
5 | `Count_occurrences
6 | `Generate
7 | `Index
8 | `Sherlodoc
9 | `Classify ]
10
11type log_line = { log_dest : log_dest; prefix : string; run : Run.t }
12
13let outputs : log_line list ref = ref []
14
15let maybe_log log_dest run =
16 match log_dest with
17 | Some (log_dest, prefix) ->
18 outputs := !outputs @ [ { log_dest; run; prefix } ]
19 | None -> ()
20
21let submit log_dest desc cmd output_file =
22 match Worker_pool.submit desc cmd output_file with
23 | Ok x ->
24 maybe_log log_dest x;
25 String.split_on_char '\n' x.output
26 | Error exn -> raise exn
27
28let submit_ignore_failures log_dest desc cmd output_file =
29 match Worker_pool.submit desc cmd output_file with
30 | Ok x ->
31 maybe_log log_dest x;
32 ()
33 | Error exn ->
34 Logs.err (fun m -> m "Error: %s" (Printexc.to_string exn));
35 ()