Simon Génier pushed to branch trace-vs-diagnose at Stefan / Typer
Commits: 6b99004e by Simon Génier at 2022-09-16T15:48:52-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.
- - - - -
28 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
The diff was not included because it is too large.
View it on GitLab: https://gitlab.com/monnier/typer/-/commit/6b99004eccd5947105d22213bb716dfdf5...
Afficher les réponses par date