I have to implement a logger class, taking a log id, and printing the necessary information, pre-read from xml code. Initially, I have a problem of logging the file name and line number.
Before when I used glog in main.cpp,
std::map<std::string, std::string>::iterator it = logs.find(logId);
LOG(ERROR) << logId;
it was printing
E0803 10:16:57.219295 10244 main.cpp:129] Incorrect input
Now I moved the function inside my logger wrapper. I'm (as expected) getting :
E0803 10:17:03.587898 10244 DummyLogger.cpp:65] Incorrect input
Everyting is logged gives the same line number of DummyLogger.cpp class now (as expected). But I would like it to print the caller's name and line number. Is that possible?