fix issues abotu the logging on Flask to avoid crashing unit tests