eio/tests/test_trace.md
Thomas Leonard 8f5043c458 Improve traceln formatting
- Set up a box so that wrapping works correctly.
- Print a `+` at the start of each trace line to show it is trace output.
- Format location tag with the rest of the output (fixes wrapping).
- Add tests for traceln.
2021-07-15 11:42:19 +01:00

15 lines
325 B
Markdown

```ocaml
# #require "eio_main";;
# open Eio.Std;;
# Eio_main.run @@ fun _env ->
traceln "One-line trace";
traceln "@[<v2>A nested list@,Foo@,Bar@]";
traceln "Trace with position" ~__POS__:("test_trace.md", 5, 1, 10);
+One-line trace
+A nested list
+ Foo
+ Bar
+Trace with position [test_trace.md:5]
- : unit = ()
```