icecream-cpp
icecream-cpp copied to clipboard
Comparison with dbg-macro
I'm used to the Python icecream library and really like this style of printf based debugging.
While looking for C++ based library, I found this repo & another one: https://github.com/sharkdp/dbg-macro
Are you aware of it? Any comparison between the two? which features one supports & the other doesn't etc?
I'll try to list the ones that I notice:
- dbg has colors, ic doesn't
- dbg prints context (file & func name) by default (not sure if there's a way to turn it off), ic can also print context
- dbg adds type of the argument as well, ic doesn't
- dbg.h issues a warning when included so we remember to remove it - nice touch!
@sharkdp, any more differences b/w these two libs?
Also found this: https://github.com/eerimoq/dbg-macro
Which has a backtrace macro.
I was not aware of dbg-macro until now. Nice library, thank you point it out! I definitively will take some ideas and inspirations from it.
About the features differences, beyond the ones that you have cited I would put that Icecream has support for printing wide characters, can print structs without iostream<<
overload using Clang's __builtin_dump_struct
, and wraps and format long lines before printing.
That from a quick look at dbg-macro. Maybe it can do more things that I'm not aware.
can print structs without
iostream<<
overload using Clang's__builtin_dump_struct
Oh cool, I didn't know about that :+1: