I’m doing an applicaton that has different classes/objects.
I would like to print all log messages to the same Logger-Object (that handles
all the file-open/close).
To be more accuate: It is not about the Logging-Class itself. It’s more about how would I create one singel Logging-Object that is available in all other objects/classes in my app. In an efficient way (not passing my logger as parameter to all new created objects).
What would be the best way to do so?
You can use a Singleton object for that,
See an example implementation here