Closed Eclipse-Dominator closed 1 year ago
If we don't want loggers to be added without a class, we can use an assertion instead. Perhaps that's simpler (especially because we currently don't have a need for such a logger -- as per YAGNI principle)?
I think this will be for the best since there is no need to such a logger.
When a logger is created with a null class, it's logs are not being logged into the log file when all logs should be recorded in the log file.
If we create a logger using a null class for instance
Logs made via this logger will not be able to write logs to the addressbook.log.0 file.
This is due to an incorrect function call to
LogsCenter.getLogger(str)
which enables logs to be written to a log file as well as other pipelines.However, when a null class is being created,
We can see that the default
Logger.getLogger()
is called instead which prevents the handlers from being added.We can verify this by modifying a logger.
We can see that logs of null class are not being properly logged.
As of now, no null loggers have been created but I think this should still be considered as a bug? or that the argument that null loggers logs should not be logged in the log file.