Logs with an arbitrary level.

@param mixed $level
@param string $message
@param array $context
@return null
183991
public function log($level, $message, array $context = array()) {
    	if (!isset(self::$levels[$level]) || $level == 'none') {
    		throw new \Psr\Log\InvalidArgumentException("Error, level '".$level."' is not a valid log level. The \$level property must be one of 'emergency', 'alert', 'critical', 'error', 'warning', 'notice', 'info', 'debug'");
    	}
    	
    	// If the level is greater than the max level we log, let's not log anything.
    	if (self::$levels[$level] > $this->level) {
    		return;
    	}
    	
    	$exceptionText = '';
    	if (isset($context['exception'])) {
    		$e = $context['exception'];
			if ($e instanceof \Exception || $e instanceof \Throwable) {
    			$exceptionText = "\n".self::getTextForException($e);
			}
    	}
		$trace = debug_backtrace();
		$string = self::interpolate((string) $message, $context);
    	error_log(strtoupper($level).': '.$trace[1]['file']."(".$trace[1]['line'].") ".(isset($trace[2])?($trace[2]['class'].$trace[2]['type'].$trace[2]['function']):"")." -> ".$string.$exceptionText);
    }
867361
public function log($level, $message, array $context = [])
    {
        if (!isset($this->logLevels[$level])) {
            $level = LogLevel::DEBUG;
        }

        if ($this->logLevels[$level] < $this->level) {
            // do not print.
            return;
        }

        if ($this->level === 3 && $this->logLevels[$level] === 3) {
            $style = 'dim';
        } else {
            $style = $this->levelStyles[$level];
        }

        if ($this->indent) {
            $this->write(\str_repeat($this->indentCharacter, $this->indent));
        }

        if (\is_object($message) || \is_array($message)) {
            $this->writeln(\print_r($message, true), $style);
        } else {
            $this->writeln($message, $style);
        }
    }
1187151
public function log(string $level, string $message, array $context = array(), $filename = null)
    {
        $this->setLogger($message, $context = [], $filename);
    }
1307853
public function log($level, $message, array $context = [])
    {
        $message = $this->factory->buildMessage($level, $message, $context);

        foreach ($this->transformers as $transform) {
            $message = $transform($message);
        }

        $formatted = ($this->serializer)($message);

        $this->messages[] = $formatted;
    }
994369
public function log($level, $message, array $context = []) {
        $realMessage = rtrim(static::interpolate($message, $context), "\n");
        $levelC = strtoupper(substr($level,0,1));
        $realMessage = sprintf("[ %1s ] %s\n", $levelC, $realMessage);

        fwrite($this->fr, $realMessage);
    }
801410
final public function log($level, $message, array $context = array())
    {
        if (isset($this->levels[$level]) && $this->levels[$level] < $this->minLevel) {
            return;
        }
    
        if (empty($this->context) && empty($context)) {
            $context = [];
        } elseif ($this->context !== $context) {
            $context = array_merge($this->context, $context);
        }
        
        $context['level'] = $level;
        $context['datetime'] = date('Y-m-d H:i:s');
        
        try {
            $this->writer->write($context['datetime'].' ['.$level.'] '.$this->prefix.$message, $context);
        } catch (Exception $e) {
            $this->handleWriteError($e, $message);
        }
    }
1206037
public static function log( $level, $message, array $context = [] )
	{
		return static::__do( __FUNCTION__, args_with_keys( func_get_args(), __CLASS__, __FUNCTION__ ) );
	}
301202
public function log($level, $message, array $context = array())
    {
        if (self::isSetLogger()) {
            return self::$logger->log($level, $message, $context);
        }

        return false;
    }
1008257
public function log($level, $message, array $context = [])
    {
        $messageWithContext = $this->interpolate($message, $context);
        switch ($level) {
            case PsrLogLevel::EMERGENCY:
                Logger::emergency($messageWithContext);
                break;
            case PsrLogLevel::ALERT:
                Logger::alert($messageWithContext);
                break;
            case PsrLogLevel::CRITICAL:
                Logger::critical($messageWithContext);
                break;
            case PsrLogLevel::ERROR:
                Logger::error($messageWithContext);
                break;
            case PsrLogLevel::WARNING:
                Logger::warning($messageWithContext);
                break;
            case PsrLogLevel::NOTICE:
                Logger::notice($messageWithContext);
                break;
            case PsrLogLevel::INFO:
                Logger::info($messageWithContext);
                break;
            case PsrLogLevel::DEBUG:
                Logger::debug($messageWithContext);
                break;
            default:
                throw new \Psr\Log\InvalidArgumentException(
                    'Unknown log level: ' . var_export($level, true),
                    1485455196
                );
        }
    }
847166
public function log($level, $message, array $context = array())
    {
        if (in_array($level, $this->levels)) {
            file_put_contents(
                $this->logFile, $message . PHP_EOL, FILE_APPEND
            );
        }
    }
929396
final protected function log(string $level, string $message, array $context = [])
    {
        $this->provider('logger')->log($level, $message, $context);
    }
166006
public function log($level, $message, array $context = array())
    {
        foreach ($this->loggerInstances as $logger) {
            $logger->log($level, $message, $context);
        }
    }
893013
public function log($level, $message, array $context = [])
    {
        if ($this->verbose) {
            fwrite(
                STDOUT,
                '[' . $level . '] [' . strftime('%T %Y-%m-%d') . '] ' . $this->interpolate($message, $context) . PHP_EOL
            );
            return;
        }
        if ($this->displayErrors) {
            if (($level === LogLevel::CRITICAL || $level === LogLevel::EMERGENCY)) {
                fwrite(
                    STDOUT,
                    '[' . $level . '] ' . $this->interpolate($message, $context) . PHP_EOL
                );
            }
        }
    }
1287363
public function log($level, $message, array $context = array()):Logger
    {
        $msg = $this->formatMessage($level, $message, $context);
        foreach ($this->handlers as $handler) {
            $handler($level, $msg);
        }
        return $this;
    }
839749
public function log($level, $message, array $context = [])
    {
        $record = new LogRecord($level, $message);

        // add all messages to session log
        $this->session->addRecord($record);

        // write record into log only if it is enough by level
        if ($this->logLevel >= $level) {
            $this->write($record);
        }
    }
277266
public function log($level, $message, array $context = array())
    {
        return error_log(self::PREFIX.' '.strtoupper($level).': '.$message.' '.
            (!empty($context) ? print_r($context, true) : ''));
    }
1084317
public function log($level, $message, array $context = array())
    {
        $errorLevel = isset(self::$map[$level]) ? self::$map[$level] : common_Logger::ERROR_LEVEL;
        $this->logger->log($errorLevel, $message, $context);
    }