C
cppquester
I have a set of classes.
All should report (send messages) to the same logger object.
But for several instantiations of the set of classes each
instantiation should use a different logger.
I could put the logger into one of the classes and then set all other
classes belonging to the same instantiation to this logger. But it is
tidious and error prone.
Any suggestions?
Background is, that I use c++ and c# together and instantiate each set
of c++ classes within its own (c#) thread.
Using a singleton for the logger causes crashes due to accessing
confilcts.
I do not see a way to synchronize the c++ threads with each other if
they are called from (multi threaded) c#.
Thanks,
Marc
All should report (send messages) to the same logger object.
But for several instantiations of the set of classes each
instantiation should use a different logger.
I could put the logger into one of the classes and then set all other
classes belonging to the same instantiation to this logger. But it is
tidious and error prone.
Any suggestions?
Background is, that I use c++ and c# together and instantiate each set
of c++ classes within its own (c#) thread.
Using a singleton for the logger causes crashes due to accessing
confilcts.
I do not see a way to synchronize the c++ threads with each other if
they are called from (multi threaded) c#.
Thanks,
Marc