Hello forum : )
Using C++ but topic probably affects similar languages as well.
I will talk about a class/object called "logger", my definition of a logger: A class that can be used by every class to print significant code-happenings to a file. E.g. new state of a state-machine has been reached.
I know globals can be very unhealthy to use and should be avoided. This is what I do, I have not a single global within my own code (what libraries provide does not count).
Nonetheless, I want to implement a logger - easy way to track bugs happening while my software is running without some debugger-console.
Users will have an easy way to help me fixing bugs, too.
So I was wondering whether global loggers are common practice or if the senior programmers would hunt and burn me if they find out :' )
Literally every component within my software could and will use the logger, so why bother passing around a logger?
Especially because nobody relies on a logger, it is a simple "write-only"-class.
Thanks a lot for your time, have a nice day : )