Closed greenozon closed 6 months ago
I"ve got another debug related idea... for the moment it's a bit hard to read the code as it has dozens (hundreds?) of patterns like for example
#ifdef __VMAWARE_DEBUG__
debug("LOADED_DLLS:", "caught error, returned false");
#endif
the idea is to simplify/refactor approach above into something like
debug("LOADED_DLLS:", "caught error, returned false");
meaning hide the #ifdef/endif wrapper over the debug() construction somehow
from my past experience I"ve implemented it like
#ifdef __VMAWARE_DEBUG__
#define debug() ... // here we call the original routine passing all the params, etc
#else
#define debug() // empty -> no code generated at all if no DEBUG mode
#endif
Let me know if you like this idea so I could take of it but first lets solve the original issue in the previous message Thank you
the __VMAWARE_DEBUG__
macro is supposed to be defined based on the cmake build type. I designed it for development purposes without the intention of being used by anybody besides myself for internal debugging.
I sorta wanted the lib to not be verbose or output anything extra, that macro was meant to be undocumented, so yeah.
About the #ifdef/#endif preprocessors, you're right that it looks messy and there should be a far better solution to what I implemented. I'll try to work on it today if I have the time :)
BTW, well this is actually another topic, but I"m just curious - are these escape symbols working only under Linux console?
I"m asking cause on Windows I'm observing pretty much funny pic, eg:
Maybe (another improvement) it worth to put those escapes into Linux (Mac?) only #ifdef, what do you think
BTW, well this is actually another topic, but I"m just curious - are these escape symbols working only under Linux console?
I"m asking cause on Windows I'm observing pretty much funny pic, eg:
uhhhh.... not sure about that one. I haven't made a debug build on Windows yet so that's new to me. I'll remove the escape character sequences in the next commit. And yeah I'll only add them only for Linux and MacOS for now
merged and fixed! :+1:
If all of a sudden you decided to see the matrix deep sea :) by defining
you'll hit something interesting ,eg:
that's cause currently the debug() routine is living inside the VM::util space, but used outside... what was the original intention - to keep it inside util or inside VM scope?