log (or no-op) based on supplied `level`
966482
function log( type, level, json ) {
  var stream, args, msg;

  if ( level >= loglevel ) {
    args = Array.prototype.slice.call( arguments, 3 );
    msg = json === true ? args[ 0 ] : format( type, args );
    stream = level > 3 ? 'stderr' : 'stdout';
    exports[ stream ].write( msg );
    exports.emit( type.toLowerCase(), msg );
  }
}
474375
def extract_log_level_from_environment(k, default):
    """"""
    return LOG_LEVELS.get(os.environ.get(k)) or int(os.environ.get(k, default))
1309529
def getLogLevelNo(level):
    """"""
    if isinstance(level,(int,long)):
        return level
    try:
        return(int(logging.getLevelName(level.upper())))
    except:
        raise ValueError('illegal loglevel %s' % level)
768299
def set_log_level(self, level=logging.INFO):
        
        mod, cls = self.parse_module_class()
        logging.getLogger(mod).setLevel(level)
419676
function getLogLevel(level, action, payload, type) {
  switch (typeof level === 'undefined' ? 'undefined' : _typeof(level)) {
    case 'object':
      return typeof level[type] === 'function' ? level[type].apply(level, _toConsumableArray(payload)) : level[type];
    case 'function':
      return level(action);
    default:
      return level;
  }
}
551621
def set_logging_level(level_name=None):
    
    can_logger = logging.getLogger('can')

    try:
        can_logger.setLevel(getattr(logging, level_name.upper()))
    except AttributeError:
        can_logger.setLevel(logging.DEBUG)
    log.debug("Logging set to {}".format(level_name))
77611
def log_level(level):
    

    levels_dict = {0: 50,
                   1: 40,
                   2: 30,
                   3: 20,
                   4: 10}

    if not isinstance(level, int):
        level = int(level)

    if level > 4:
        level = 4

    return levels_dict[level]
1325047
public void log(String message, Level level) {
    log(null, null, message, level);
  }
1036538
def set_log_level_command(opts)
      Log.level = opts[:level] if [ :debug, :info, :warn, :error, :fatal ].include?(opts[:level])
      CommandIO.instance.reply(opts[:conn], Log.level)
    end
792861
def log_level_type(arg):
	""""""
	if not arg.upper() in ('NOTSET', 'DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'):
		raise argparse.ArgumentTypeError("{0} is not a valid log level".format(repr(arg)))
	return getattr(logging, arg.upper())
36344
boolean shouldLog(int level) {
        switch (level) {
            case 8:
                return false;
            case 7: // SEVERE
                return _tc.isErrorEnabled();
            case 6: // WARN
                return _tc.isWarningEnabled();
            case 5: // INFO
                return _tc.isInfoEnabled();
            case 4: // CONFIG
                return _tc.isConfigEnabled();
            case 3: // FINE
                return _tc.isEventEnabled();
            case 2: // FINER
                return _tc.isEntryEnabled();
            case 1: // FINEST
            case 0: // TRACE
            default:
                return _tc.isDebugEnabled();
        }// end switch
    }
933152
def _log(self, level, msg, args, exc_info=None, extra=None):
        """"""
        if exc_info and not isinstance(exc_info, tuple):
            exc_info = sys.exc_info()

        self.append(HistoryRecord(level, "unknown filename", 0, msg, args, exc_info, func="unknown func"))
85383
public void log(Level level, String format, Object... args)
    {
        if (isLoggable(level))
        {
            if (format != null)
            {
                logIt(level, String.format(format, args));
            }
            else
            {
                logIt(level, String.format("%s format == null", level));
            }
        }
    }
1355796
def get_loglevel(level):
    
    if level == 'debug':
        return logging.DEBUG
    elif level == 'notice':
        return logging.INFO
    elif level == 'info':
        return logging.INFO
    elif level == 'warning' or level == 'warn':
        return logging.WARNING
    elif level == 'error' or level == 'err':
        return logging.ERROR
    elif level == 'critical' or level == 'crit':
        return logging.CRITICAL
    elif level == 'alert':
        return logging.CRITICAL
    elif level == 'emergency' or level == 'emerg':
        return logging.CRITICAL
    else:
        return logging.INFO
1337533
def logging_level(level):
    
    level = level.upper()
    levels = [DEBUG, INFO, WARNING, ERROR, CRITICAL, VERBOSE]
    level_names = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'VERBOSE']

    if level not in level_names:
        raise Exception("Level %r not in %r" % (level, levels))

    param_logger = get_logger()
    logging_level = param_logger.getEffectiveLevel()
    param_logger.setLevel(levels[level_names.index(level)])
    try:
        yield None
    finally:
        param_logger.setLevel(logging_level)
1005319
def log_level(io_handler, level=None, name=None):
        
        # Get the logger
        logger = logging.getLogger(name)

        # Normalize the name
        if not name:
            name = "Root"

        if not level:
            # Level not given: print the logger level
            io_handler.write_line(
                "{0} log level: {1} (real: {2})",
                name,
                logging.getLevelName(logger.getEffectiveLevel()),
                logging.getLevelName(logger.level),
            )
        else:
            # Set the logger level
            try:
                logger.setLevel(level.upper())
                io_handler.write_line("New level for {0}: {1}", name, level)
            except ValueError:
                io_handler.write_line("Invalid log level: {0}", level)
674976
function setLogLevel(level){

    level = level > 0 ? level : 0;
    level = level < 4 ? level : 4;
    level = parseInt(level);
    
    logLevel = level; 

}