let target
?build_process_details ?condition_details ?(metadata_details=false) t =
let open Log in
let doc_build_process = build_process in
let doc_condition = condition in
let doc_metadata = metadata in
let open Target in
let itemize l =
indent (concat (List.map l ~f:(fun (name, log) ->
s "* " % s name % s ": " % log %n))) in
s "Target " % a name t % n
% itemize [
"ID", a id t;
"Dependencies", OCaml.list s (depends_on t);
"Failures", OCaml.list s (on_failure_activate t);
"Successes", OCaml.list s (on_success_activate t);
"Metadata", OCaml.option (doc_metadata ~full:metadata_details) (metadata t);
"Build-process",
doc_build_process ?with_details:build_process_details
(Target.build_process t);
"Condition",
doc_condition ?with_details:condition_details (Target.condition t);
"Equivalence", (match equivalence t with
| `None -> s "None"
| `Same_active_condition -> s "Same active condition");
"Tags", OCaml.list quote (tags t);
"Status", short_status t;
"Additional Log",
OCaml.list (fun (time, msg) ->
brakets (Time.log time) % s ": " % s msg) (additional_log t);
]