kevinmehall / rust-peg

Parsing Expression Grammar (PEG) parser generator for Rust
https://crates.io/crates/peg
MIT License
1.46k stars 106 forks source link

Use tracing rather than println? #344

Open stevefan1999-personal opened 1 year ago

stevefan1999-personal commented 1 year ago
          @kevinmehall Umm the test failed because it was running under `no_std` context, and indeed there is no `println` macro. Wonder if we should also take this out too and instead of printing to the console, let's put them all together into a `Vec<String>` or let's even structuralize it. And then we could print it out altogether in the end. This could also help external compiler tracing, but I would like to keep this into another PR.

Originally posted by @stevefan1999-personal in https://github.com/kevinmehall/rust-peg/issues/338#issuecomment-1501703293

This mean we should use https://docs.rs/tracing/latest/tracing/#crate-feature-flags. Of course, this could mean it will have to pull in a very huge dependency...

Since most of the peg usage already implied the need of an allocator, I think this is pretty fine.