If you are using a version of Visual Studio, you could just pass the __FUNCTION__ macro into your logging function.
e.g.
_log.debug("message", __FUNCTION__);
The function macro will pass the name of the current function as a string.
see: http://msdn.microsoft.com/en-us/library/b0084kay%28v=vs.80%29.aspx
I think the __FUNCTION__ macro is also defined in gcc, so it should work for gcc, g++, mingw and cygwin too.
But if you're using another compiler, you might have to consult its documentation to see if there are any similar macros defined!
JasonHippy
Practically a Posting Shark
862 posts since Jan 2009
Reputation Points: 615
Solved Threads: 146
Skill Endorsements: 5
Question Answered as of 8 Months Ago by
JasonHippy