> Issue I am facing is at if(CLogger::oLogger != NULL) which is always returning oLogger as NULL.
You initialized it as a null pointer, and never assigned a different value to it after that.
1 2 3 4 5 6 7 8 9 10 11 12 13
Log::Log()
{
// this defines a local variable with automatic storage duration called 'oLogger'
LoggerPtr oLogger(Logger::getLogger("Test"));
// this assigns a value to the static member variable 'oLogger'
oLogger = Logger::getLogger("Test") ;
// same as above, but perhaps makes the intent a tad clearer
Log::oLogger = Logger::getLogger("Test") ;
// ...
}