12 ms·
Rust’s `dbg!()` macro also includes the source file name and line number; this C++ `dbg(…)` macro looks to add source file name, line number and function name.
by chrismorgan 7y ago
Rust’s `dbg!()` macro also includes the source file name and line number; this C++ `dbg(…)` macro looks to add source file name, line number and function name.
- xtreak29 7y agoI proposed the idea but the debugging notation seemed to serve a different audience : https://discuss.python.org/t/filename-and-line-number-in-f-string-debugging-output/1650/ https://discuss.python.org/t/filename-and-line-number-in-f-s...
- giancarlostoro 7y agoWow I had no idea you could do that with the logging class. I agree it would be smarter to be able to at least have a flag for that to print the rest. Overall I prefer logging to print. I do think you are right though: if you are trying to debug it is useful to know the line not just a variable name. Now you gotta add garbage to say hey this was from this method and line...