public static function getLevelNumber($level)
    {
        $levels = Logger::getLevels();

        if (!isset($levels[$level])) {
            throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', $levels));
        }

        return $levels[$level];
    }