Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison with dbg-macro #31

Open
dufferzafar opened this issue Jun 30, 2022 · 5 comments
Open

Comparison with dbg-macro #31

dufferzafar opened this issue Jun 30, 2022 · 5 comments

Comments

@dufferzafar
Copy link

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?

@dufferzafar
Copy link
Author

dufferzafar commented Jun 30, 2022

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?

@dufferzafar
Copy link
Author

Also found this: https://github.com/eerimoq/dbg-macro

Which has a backtrace macro.

@renatoGarcia
Copy link
Owner

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.

@renatoGarcia
Copy link
Owner

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.

@sharkdp
Copy link

sharkdp commented Aug 4, 2022

can print structs without iostream<< overload using Clang's __builtin_dump_struct

Oh cool, I didn't know about that 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants