Explicit relation to MainClass

MainClass is a dependency on which CustomLogger listens to events. Storage of the current log level is also more explicit with a variable explicitly stored.