Test the incoming debug_level, rather than the current.
The existing code tests the current debug_level for validity, allowing
the user to set it too high and never change it after that. The new
behaviour is to test the debug_level that the user has requested.