Parse new level.
@private
@param {Object} level
491035
function (level) {

    if (!level || typeof level !== 'object') {
      throw new Error('The first parameter must be an object describing the level.');
    }
    if (typeof level.name !== 'string' || !level.name.length) {
      throw new Error('The level object must have a name property.');
    }

    return extend({
      name: null,
      priority: 3,
      color: null
    }, level);
  }
1115995
function level(l) {
        var sysl;

        switch (l) {
        case bunyan.FATAL:
                sysl = LOG_EMERG;
                break;

        case bunyan.ERROR:
                sysl = LOG_ERR;
                break;

        case bunyan.WARN:
                sysl = LOG_WARNING;
                break;

        case bunyan.INFO:
                sysl = LOG_INFO;
                break;

        default:
                sysl = LOG_DEBUG;
                break;
        }

        return (sysl);
}
122663
public function level($level)
    {
        if (empty($level)) {
            $level = [];
        } elseif (is_string($level)) {
            $level = explode(',', str_replace(' ', '', $level));
        } else {
            $level = is_array($level) ? $level : func_get_args();
        }

        $this->setLevel($level);

        return $this;
    }
292227
function setLevel(level) {
        if (typeof(level) === "number") {
            if (level >= 0 && level <= 5) {
                _level = level;
            } else {
                invalidParameter(level);
            }
        } else if (typeof(level) === 'string') {
            if (Level.hasOwnProperty(level)) {
                _level = Level[level];
            } else {
                invalidParameter(level);
            }
        } else {
            invalidParameter(level);
        }
        return createObject();
    }
1208043
def setLevel(self, level):
		
		if isinstance(level, int):
			self.logger.setLevel(level)
			return

		# level en tant que string
		level = level.lower()
		if level == "debug":
			self.logger.setLevel(logging.DEBUG)

		elif level == "info":
			self.logger.setLevel(logging.INFO)

		elif level == "warning" or level == "warning":
			self.logger.setLevel(logging.WARN)

		elif level == "error":
			self.logger.setLevel(logging.ERROR)

		else:
			# par défaut
			self.logger.setLevel(logging.INFO)
1315329
def level(self, lvl=None):
        ''''''
        if not lvl:
            return self._lvl
        self._lvl = self._parse_level(lvl)
        self.stream.setLevel(self._lvl)
        logging.root.setLevel(self._lvl)
1194813
def collect_level level , objects
      next_level = Array.new
      #puts "collect level #{level} #{objects.length}"
      objects.each do |object|
        #puts "collect level #{level} #{object.object_id}"
        # not storing simple (value) objects
        next if is_value?(object)
        case object.class.name
        when "Array" , "Parfait::List"
          collect_array object , next_level
        when "Hash" , "Parfait::Dictionary"
          collect_hash object, next_level
        else
          # and recursively add attributes
          attributes = attributes_for(object)
          attributes.each do |a|
            val = get_value( object , a)
            next_level << val
          end
          #TODO get all superclsses here, but this covers 99% so . . moving on
          superclasses = [object.class.superclass.name]
          if superclasses.include?( "Array") or superclasses.include?( "Parfait::List")
            collect_array object, next_level
          end
          if superclasses.include?( "Hash") or superclasses.include?( "Parfait::Dictionary")
            collect_hash object, next_level
          end
        end
      end
      new_objects = next_level.collect { |o| add_object(o , level + 1) }
      new_objects.compact!
      # recurse , but break off if hit bottom
      collect_level( level + 1 , new_objects) unless new_objects.empty?
    end
398
function initialize() {
  var flags = [];

  Object.keys( levels ).forEach(function( type, level ) {
    var method = type.toLowerCase();
    exports[ method ] = log.bind( exports, type, level, false );
    exports[ method ].json = log.bind( exports, type, level, true );
    if ( new RegExp( '\\b' + type + '\\b', 'i' ).test( env ) ) {
      flags.push( level );
    }
  });

  loglevel = Math.min.apply( Math, flags );
}
98429
function(floors, options, callback) {
                if(floors && options && options.ascending === false) {
                    levelController.saveCurrentLevel(Level.create(options.identifierRange.min), function(error) {
                        if(error) {
                            logger.error('>>>> Stuck at floor ' + options.identifierRange.min + '. Failed to store the current level.');
                        }
                        return callback(error);
                    });                    
                } else {
                    return callback(null);
                }
            }
883704
function (level) {
    var lowerCaseLevel = level.toLowerCase();
    if (_.contains(LEVELS, lowerCaseLevel)) {
      return lowerCaseLevel;
    } else {
      return LEVEL_OFF;
    }
  }
517946
public void setLevel (Level level) {

		this.defaultLevel = level;
		logger.setLevel (level);
		for (Handler handler : logger.getHandlers ()) {
			handler.setLevel (level);
		}
	}
234017
function getLevel(nameOrValue) {
  if (typeof nameOrValue === 'string') {
    return LEVELS_BY_NAME.get(nameOrValue) || Level.ALL;
  }
  if (typeof nameOrValue !== 'number') {
    throw new TypeError('not a string or number');
  }
  for (let level of ALL_LEVELS) {
    if (nameOrValue >= level.value) {
      return level;
    }
  }
  return Level.ALL;
}
1082774
function step2 ( map ) {
				var root = { name : "/", nodes : []};
				return ( function next ( map, parent, level ) {
					gui.Object.each ( map, function ( key, val ) {
						var node = { name : key };
						if ( typeof ( val ) === "object" ) {
							node.nodes = [];
							node.open = level < 1;
							next ( val, node, level + 1 );
						} else {
							node.src = val;
						}
						parent.nodes.push ( node );
					});
					return parent;
				}) ( map, root, 0 );
			}
116849
function dump_dom_levels($node, $level = 0) 
    {
        $class = get_class($node);
        if ($class == "DOMNodeList") {
            echo "Level $level ($class): $node->length items\n";
                foreach ($node as $child_node) {
                echo $level.':'.$child_node->getNodePath() . "\n";
                dump_dom_levels($child_node, $level+1);
            }
        } else {
            $nChildren = 0;
            foreach ($node->childNodes as $child_node) {
                if ($child_node->hasChildNodes()) {
                    $nChildren++;
                }
            }
            if ($nChildren) {
                echo "Level $level ($class): $nChildren children\n";
            }
            foreach ($node->childNodes as $child_node) {
                echo $level.':'.$child_node->getNodePath() . "\n";
                if ($child_node->hasChildNodes()) {
                    dump_dom_levels($child_node, $level+1);
                }
            }
        }
    }
264148
function doInsertHeading(level){
  var rep = this.rep,
    documentAttributeManager = this.documentAttributeManager;
  if (!(rep.selStart && rep.selEnd) || (level >= 0 && tags[level] === undefined))
  {
    return;
  }
  
  var firstLine, lastLine;
  
  firstLine = rep.selStart[0];
  lastLine = Math.max(firstLine, rep.selEnd[0] - ((rep.selEnd[1] === 0) ? 1 : 0));
  _(_.range(firstLine, lastLine + 1)).each(function(i){
    if(level >= 0){
      documentAttributeManager.setAttributeOnLine(i, 'heading', tags[level]);
    }else{
      documentAttributeManager.removeAttributeOnLine(i, 'heading');
    }
  });
}
1279389
function generateLevelMap () {
  LEVELS.forEach(level => {
    const levelIndex = LEVELS.indexOf(level)
    levelMap[level] = {}
    LEVELS.forEach(type => {
      const typeIndex = LEVELS.indexOf(type)
      if (typeIndex <= levelIndex) {
        levelMap[level][type] = true
      }
    })
  })
}
821542
private Level toTinyLevel(cn.hutool.log.level.Level level) {
		Level tinyLevel;
		switch (level) {
		case TRACE:
			tinyLevel = Level.TRACE;
			break;
		case DEBUG:
			tinyLevel = Level.DEBUG;
			break;
		case INFO:
			tinyLevel = Level.INFO;
			break;
		case WARN:
			tinyLevel = Level.WARNING;
			break;
		case ERROR:
			tinyLevel = Level.ERROR;
			break;
		case OFF:
			tinyLevel = Level.OFF;
			break;
		default:
			throw new Error(StrUtil.format("Can not identify level: {}", level));
		}
		return tinyLevel;
	}