convert debug to debug_level