Print file, function and line number for debugging


#1

Is there anything like

std::cerr << __FUNCTION__;

in rust where i could print file, function and line number etc. Would be very helpful indeed.


#2

there are a few macros: line!, column! and file!

You can find a bunch of other useful macros in the standard library documentation (look at the bottom of the page)


#3

Ah wonderful thank you


#4

oh no there is nothing for function name though - or did i miss it. That would be the most crucial one for me.


#5

I think they reasoned that filename, line and column would be enough for debugging.