Ok, thanks, I understand what you are meaning to use it for.
The way I was planning to do it is pass the object along to each class/object as needed.
So if I created a new object from the class where I first created the logger object (i.e. m_ErrorLog), I would then use: anotherObject = new className anotherObject(m_ErrorLog); <--- passing the object between other objects created
Then in the newObject, I will then just reference the logging method (logError), I wouldn't instantiate a new logger object again.
What I have read is that there is debate on the use of the Singleton class, and that there are "better" ways to do things.
I don't have enough experience and knowledge to have an opinion, but it seemed to me that if people were throwing into question using it, then I should look at other ways to do it.
Is my passing of objects around bad?
Bookmarks