def get_loglevel(level):
 if isinstance(level, string_t):
  return LOG_LEVELS[level]
 return level

def get_loglevel ( level ) : if isinstance ( level , string_t ) : return LOG_LEVELS [ level ] return level
get loglevel by name .