Fixed the logging during debug mode