use logging library to replace error_q and print