Simon Génier pushed to branch trace-vs-diagnose at Stefan / Typer
Commits: a1c5194c by Simon Génier at 2022-09-16T09:56:24-04:00 Logging overhaul.
This changeset splits logging into two different concepts. - Diagnostics are meant for users of the compiler working on Typer code. - Tracing are meant for developers of the compiles working on Ocaml code. (I know the Venn diagram of these two kinds of people is a perfect circle… for now.)
The practical difference between the two is that tracing does not expect the compiler to finish. Messages are printed right away and the channel is flushed after every message. It can also be enabled on per module basis so you don't get the full firehose. For example, setting TYPER_TRACE="TC=debug,EVAL=info,error" will show only error trace messages, except for EVAL where info messages will be shown too and TC where messages down to the debug level will be.
Diagnostics are similar to the logs we had: they are collected and printed at the end. Their presence can make the compilation fail.
- - - - -
30 changed files:
- samples/nat.typer - src/REPL.ml - + src/array.ml - src/builtin.ml - src/debruijn.ml - src/debug.ml - src/elab.ml - src/env.ml - src/eval.ml - src/fmt.ml - src/gambit.ml - src/heap.ml - src/instargs.ml - src/inverse_subst.ml - src/lexer.ml - src/lexp.ml - src/listx.ml → src/list.ml - src/log.ml - src/opslexp.ml - src/pexp.ml - src/prelexer.ml - src/sexp.ml - src/source.ml - + src/string.ml - src/unification.ml - tests/dune - tests/eval_test.ml - tests/instargs_test.ml - tests/lexer_test.ml - tests/samples_test.ml
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/monnier/typer/-/commit/a1c5194c7cbc9f5b9fb3fc64e8cdd3b1ac...