Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Would it be preferably to declare member variable in each module in its constructor using this approach or get the instance like this in each member function? Chances are the modules is gonna log in many functions not just one. Alternatively why don't just declare static member functions as well like Logger::Write("logging on the fly!") that way we don't even need to access the object?