[PATCH 1/5] log: Add log_check_level function