I'm trying to make a generic logger class for help with debugging an application I'm working on (project that I can't use any debuggers with for a plethora of reasons).
Anyway, I'm trying to create a simple static class that I can call methods on from within any polymorphic object and have it automatically output the name of the object's class.
This is what I have so far, and it doesn't actually work haha
The idea is that I call it as such (from within any class - everything I want to test on has virtual methods so typeid shouldnt be a problem I think):
string Logger::debugMessage(void *o, string outText)
string ret = typeid(o).name()+string(": ")+outText+string(" ");
Going through everything and adding a 'typeName' property isn't really an option as far as I see it, I'd much rather do this properly than resort to a hacky method like that.
macros::debugMessage(this, "calling someMethod");
Thanks for any help