Initialization of singleton Logger can lead to confusion
Created by: gkirgizov
Because Logger is singleton, the initialization is called only once. But if someone tries to call Log
with custom file after someone somewhere at some point already called init with default arguments -- end user wouldn't know that their arguments (log file, logging level etc.) were ignored.
Tests were an example of such situation, when some test initializes the logger, while subsequent tests also try doing this with other arguments without success.
It's better to either separate logging settings (e.g. log file) from singleton init, or at least provide some warnings about ignored init arguments on subsequent calls (if they differ from actual arguments).
Example with logger run_log_example
and test_logger.py
should be reviewed after this.