I'm used to this:
class Db {
_Commit(char *file, int line) {
Log("Commit called from %s:%d", file, line);
}
};
#define Commit() _Commit(__FILE__, __LINE__)
but the big problem is that I redefine the word Commit
globally, and in a 400k lines application framework it's a problem. And I don't want to use a specific word like DbCommit
: I dislike redundancies like db->DbCommit()
, or to pass the values manually everywhere: db->Commit(__FILE__, __LINE__)
is worst.
So, any advice?