I wrote a python module in c++. All works fine but now I want to add logging. My logger class (3rd party) requires initializtion similar to:
int main()
{
Logger logger("log.log");
Logger::Register(&logger);
DoSomethingAndLog();
return 0;
}
As you can see logger
is created when the program is initialized and destructed when program is terminated.
Where would I create the Logger
object so that it would be constructed upon module loading and destructed when the module is unloaded?