In the main code, I have an instance of a class called "debugPrinterObject".
After instantiating it, I pass one of it's functions as an argument to another class called "bSoupProcessor" which processes text. Any logging information is saved to a text file using the function passed into the constructor of the bSoupProcessor class.
This is done so that the file is held open by the debugPrinterObject, and editable through the function passed as an argument. the text file is only closed at the end of the program.
It is working so far. I am going to implement multi threading, where there will be multiple "bSoupProcessor" classes, and they will all be using the same function of the "debugPrinterObject". Is this possible? are there any problems/risks?
The only dangers are the typical concurrency issues you'd face in this situation. Be sure to either use Lock objects inside your logging method, or use them in bSoupProcessor before calling it.