[PATCH] Add sanity checks for the log level