Added a configurable log system. Traces must now use the Error module functions like this example:
let foo () =
Error.info (fun m -> m "all is ok");
match computation () with
| code ->
Error.debug (fun m -> m "computation returned %i" code)
| exception e ->
Error.err (fun m -> m "oups (%a)" Fmt.exn e)
It's also possible to construct Rust like error messages by packing sub logs :
let bar () =
match another_computation () with
| code -> ()
| exception e ->
Error.(err (fun m -> m "something went wrong" ~tags:!![
primary "there was an error";
secondary "identified by exception %a" Fmt.exn e;
hint "program correctly please !"
]))
Positions can be added to messages so that such logs can be rendered in a Rust (or whatever) style later.
This PR also gives a true command line system in order to configure logs (colors, GNU style and log selectors for now but more can be added later).
Added a configurable log system. Traces must now use the
Error
module functions like this example:It's also possible to construct Rust like error messages by packing sub logs :
Positions can be added to messages so that such logs can be rendered in a Rust (or whatever) style later.
This PR also gives a true command line system in order to configure logs (colors, GNU style and log selectors for now but more can be added later).