{"repo":"sharkdp/dbg-macro","free":true,"listed":false,"github":"https://github.com/sharkdp/dbg-macro","clone":"git clone https://github.com/sharkdp/dbg-macro.git","description":"A dbg(…) macro for C++","language":"C++","stars":3232,"topics":["cpp","debugging","macro","pretty-printing"],"license":"MIT","category":"dev-tools","readme_excerpt":"dbg(…) A macro for printf -style debugging fans. Debuggers are great. But sometimes you just don't have the time or patience to set up everything correctly and just want a quick way to inspect some values at runtime. This projects provides a single header file with a dbg(…) macro that can be used in all circumstances where you would typically write printf(\"…\", …) or std::cout () helper to pretty-print a given type T . For example: Print the current time To print a timestamp, you can use the dbg::time() helper: Customization If you want dbg(…) to work for your custom datatype, you can simply overload operator<< for std::ostream& : If you want to modify the type name that is printed by dbg(…) , you can add a custom get type name overload: Development If you want to contribute to dbg-macro , here is how you can build the tests and demos: Make sure that the submodule(s) are up to date: Then, use the typical cmake workflow. Usage of -DCMAKE CXX STANDARD=17 is optional, but recommended in order to have the largest set of features enabled: To run the tests, simply call: You can find the unit tests in tests/basic.cpp . Acknowledgement This project is inspired by Rusts dbg!(…) macro.","default_branch":null,"files":null,"tree":[],"storefront":"/r/sharkdp","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/sharkdp/dbg-macro/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}