def _check_loglevel(level='info', quiet=False):
 def _bad_level(level):
  log.error("Invalid output_loglevel '{0}'. Valid levels are: {1}. Falling back to 'info'.".format(level, ', '.join(sorted(LOG_LEVELS, reverse=True))))
  return LOG_LEVELS['info']
 if (salt.utils.is_true(quiet) or (str(level).lower() == 'quiet')):
  return None
 try:
  level = level.lower()
  if (level not in LOG_LEVELS):
   return _bad_level(level)
 except AttributeError:
  return _bad_level(level)
 return LOG_LEVELS[level]

def _check_loglevel ( level = 'info' , quiet = False ) : def _bad_level ( level ) : log . error ( "Invalid output_loglevel '{0}'. Valid levels are: {1}. Falling back to 'info'." . format ( level , ', ' . join ( sorted ( LOG_LEVELS , reverse = True ) ) ) ) return LOG_LEVELS [ 'info' ] if ( salt . utils . is_true ( quiet ) or ( str ( level ) . lower ( ) == 'quiet' ) ) : return None try : level = level . lower ( ) if ( level not in LOG_LEVELS ) : return _bad_level ( level ) except AttributeError : return _bad_level ( level ) return LOG_LEVELS [ level ]
retrieve the level code for use in logging .