reasonml / reason-native

Testing, printing, coloring, and other tools to effectively write native Reason code.
https://reason-native.com/
MIT License
459 stars 43 forks source link

Console: Additional log levels: 'trace', 'info' #26

Open bryphe opened 5 years ago

bryphe commented 5 years ago

For the Console API, there are a few log levels that are missing when comparing to the Node API, specifically:

Would it make sense to these in the Console API here? https://github.com/facebookexperimental/reason-native/blob/0b6adb98152225e87295cc1d2fbc984b68f68c7c/src/console/library/Console.re#L9

kyldvs commented 5 years ago

I would like to see info, I'm not sure what trace means though, I've never used it. What is the purpose of that level?

bryphe commented 5 years ago

trace is mainly for debugging - it prints to stderr with the message + stack trace for convenience. Helpful when debugging, or if there is some corner case you hit that you want to make visible in the logs.

It'd be basically debug but tagged with a stacktrace: Printexc.raw_backtrace_to_string(Printexc.get_raw_backtrace())