My question is simple: should I create my Debug
class as a singleton?
I know that the singleton pattern is a bad practice, but a debug class does not take part in the logic in an app, and it would complexify the entire application to inject the debug class into every class.
My debug class would contain methods such as:
Debug::message();
Debug::dump();
Debug::spot(); // To create a timeline
// etc
It should also be noted that I use the debugbar package, and that it will only be present in dev mode, so my debug class will look if the package is present, if so, it will pass the informations to it, otherwise, it will just do nothing (or maybe log important things).