@param string $level
@param string $formatted

@return bool
773860
public function send(string $level, string $formatted): bool
    {
        if ($this->config[self::CONFIG_TYPE] === self::FILE) {
            return error_log($formatted . "\n", $this->config[self::CONFIG_TYPE], $this->config[self::CONFIG_FILE]);
        } else {
            return error_log($formatted, $this->config[self::CONFIG_TYPE]);
        }
    }
821758
public function deliver(string $level, array $data): bool
    {
        $this->isDelivered = false;
        if (!$this->canLog($level)) {
            return $this->isDelivered;
        }
        return $this->isDelivered = $this->handler->handle($level, $this->formatter->format($data));
    }
358417
public function log($msg, $level = self::INFO, array $data = [])
    {
        if (is_numeric($level) && $level > $this->level) {
            return true;
        }

        $strData = $data ? json_encode($data) : '';

        if ($this->toSyslog) {
            return $this->sysLog($msg . ' ' . $strData, $level);
        }

        $label = self::getLevelName($level);
        $ds = FormatHelper::microTime(microtime(true));

        // [$this->getPidRole():$this->pid] $msg
        $logString = sprintf("[%s] [%s] %s %s\n", $ds, $label, trim($msg), $strData);

        // if not in daemon, print log to \STDOUT
        if (!$this->toConsole) {
            $this->stdout($logString, false);
        }

        if ($this->fileHandle) {
            $this->count++;
            $this->cache[] = Cli::clearColor($logString);

            if ($this->count >= $this->logThreshold || $this->fileIsChanged()) {
                $this->flush();
            }
        }

        return true;
    }
709167
function getPrevLevel($level)
    {
        $levels = $this->getLevels();
        $level_incdeces = $this->getLevelIndeces();
        $level_index = $level_incdeces[$level];
        if (!isset($levels[$level_index - 1])) {
            return false;
        }
        $prev_level = $levels[$level_index - 1];
        return $prev_level;
    }
920719
public function formatted($isFormatted=null)
    {
        if (isset($isFormatted)) {
            $this->data['formatted'] = $isFormatted;
            return $this;
        }
        
        return isset($this->data['formatted']) ? $this->data['formatted'] : false;
    }
243868
public function save(File $formatter): bool
    {
        $isCached = $this->isSaved();
        $isEmpty = $this->isEmpty();
        if ($isCached && !$isEmpty) {
            $formatter->triggerEvent(File::EVENT_CACHED);

            return true;
        }
        if ($isEmpty) {
            $formatter->triggerEvent(File::EVENT_EMPTY);

            return false;
        }

        // checks if path is writable
        // create new empty file or override existed one
        // also caches empty result for non-formatted files
        $this->filesystem->put($this->path, null);

        $content = $formatter->getContent();
        if ($content === false) {
            $formatter->triggerEvent(File::EVENT_NOT_FOUND);

            return false;
        }
        if ($content === '') {
            $formatter->triggerEvent(File::EVENT_ERROR);

            return false;
        }

        $saved = $this->write($content);

        $formatter->triggerEvent($saved ? File::EVENT_CACHED : File::EVENT_ERROR);

        return $saved;
    }
606653
public function Level($level)
    {
        $parent = $this;
        $stack = array($parent);
        while ($parent = $parent->Parent) {
            array_unshift($stack, $parent);
        }

        return isset($stack[$level-1]) ? $stack[$level-1] : null;
    }
166245
private String formatLevel(Event.Level level) {
        if (level == null) {
            return null;
        }

        switch (level) {
            case DEBUG:
                return "debug";
            case FATAL:
                return "fatal";
            case WARNING:
                return "warning";
            case INFO:
                return "info";
            case ERROR:
                return "error";
            default:
                logger.error("The level '{}' isn't supported, this should NEVER happen, contact Sentry developers",
                    level.name());
                return null;
        }
    }
166144
public function indent($level = null)
    {
        $level = $level ?: $this->getLevel();
        array_push($this->indentStack, $level);

        return $level;
    }
1113138
protected function get_header($header = null, $formatted = true)
	{
		if ($header === null)
		{
			return $this->headers;
		}

		if (array_key_exists($header, $this->headers))
		{
			$prefix = ($formatted) ? $header.': ' : '';
			$suffix = ($formatted) ? $this->config['newline'] : '';
			return $prefix.$this->headers[$header].$suffix;
		}

		return '';
	}
323831
public function rollBack($levels = null): bool
    {
        if(null === $levels)
        {
            $this->transactionLevels = 0;
        }
        else
        {
            $this->transactionLevels -= $levels;
        }
        return true;
    }
1116497
protected function write($object, $level)
    {
        if ($this->enabled && $this->writer && $level <= $this->level) {
            return $this->writer->write($object, $level);
        } else {
            return false;
        }
    }
169655
public function isSuccess($level = HealthCheckTestResultInterface::WARNING)
    {
        /** @var HealthCheckTestResultInterface $result */
        foreach ($this->results as $result) {
            if (true === $result->isError() && $result->getLevel() >= $level){
                return false;
            }
        }

        return true;
    }
250916
public static function upc($str, bool $formatted=false) {
		ref\sanitize::upc($str, $formatted);
		return $str;
	}
993014
public function level($level, $operator = '>=')
	{
		if (!$this->user())
		{
			return false;
		}

		$userCaps = array_keys($this->getUser()->allcaps);

		foreach ($userCaps as $cap)
		{
			// get just the first, higher
			if (substr($cap, 0, 6) === 'level_')
			{
				return $this->checkWithOperator(substr($cap, 6), $level, $operator);
			}
		}

		return false;
	}
871281
private function isValidLogLevel($level)
    {
        return in_array($level, array(
                LogLevel::EMERGENCY,
                LogLevel::ALERT,
                LogLevel::CRITICAL,
                LogLevel::ERROR,
                LogLevel::WARNING,
                LogLevel::NOTICE,
                LogLevel::INFO,
                LogLevel::DEBUG,
            )
        );
    }
288477
public static function builtInFormatCodeIndex($formatCode)
	{
		// Ensure built-in format codes are available
		self::fillBuiltInFormatCodes();

		// Lookup format code
		if (isset(self::$_flippedBuiltInFormats[$formatCode])) {
			return self::$_flippedBuiltInFormats[$formatCode];
		}

		return false;
	}