Logs time and memory usage

@param string $string A string to identify the entry in the log
@param array $context Arbitrary data to log
434086
public function log($string, $context = []) {
        if (!$this->enabled) {
            return;
        }

        $this->logger->info($string, [
                'time' => static::formatTime(static::getTime() - $this->start_time),
                'memory' => static::formatSize(memory_get_usage()),
                'memory_bytes' => memory_get_usage(),
                'time_microtime' => static::getTime() - $this->start_time,
            ] + $context);
    }
886773
static public function traceMemory($context=null)
    {
        $caller = static::getCaller();
        $memory_usage = memory_get_usage();
        $message = sprintf('%30s::%-15s: %s', $caller['class'], $caller['function'], $memory_usage);
        if ($context) {
            $message .= ' ' . print_r($context, true);
        }
        
        Ioc::logger('trace')->debug(sprintf('[%s]%s', 'memory', $message));
    }
1053170
public function log($level, $message, array $context = array())
    {
        $this->getApplication()->getInitialContext()->getSystemLogger()->log($level, $message, $context);
    }
884233
public function log($level, $message, array $context = array())
    {
        $this->logMessage(
            $level,
            (
                $this->getLevelColor($level)
                . $this->getFormattedMessage($level, $message)
                . $this->getDefaultColor()
            )
        );
    }
1092582
public function e($text, $context = array())
    {
        $this->log->error($text, $context);
        $this->emit(self::SIGNAL_ERROR_ENTERED);
    }
929396
final protected function log(string $level, string $message, array $context = [])
    {
        $this->provider('logger')->log($level, $message, $context);
    }
1189136
public function log($level, $message, array $context = array())
    {
        $context = $this->parseContext($context);
        $trace = $context['trace'];
        $logTime = time();
        $record = new Record($level, $message, $context, $trace, $logTime);
        foreach($this->handlers as $handler)
        {
            $handler->log($record);
        }
    }
600082
public function log($level, $message, array $context = array()) {
		if($this->maxLength < mb_strlen($message, $this->charset)) {
			$ellipses = iconv('UTF-8', $this->charset, $this->ellipsis);
			$message = mb_substr($message, 0, $this->maxLength - strlen($this->ellipsis), $this->charset);
			$message = $message . $ellipses;
		}
		$this->logger()->log($level, $message, $context);
	}
166006
public function log($level, $message, array $context = array())
    {
        foreach ($this->loggerInstances as $logger) {
            $logger->log($level, $message, $context);
        }
    }
706515
public function log($level, $message, array $context = [])
    {
        $context_output = empty($context) ? '' : sprintf(' :: %s', json_encode($context));

        $logline = sprintf("[%s] %s%s\n", strtoupper($level), $message, $context_output);

        $handle = in_array($level, self::ERROR_LEVELS, false) ? STDERR : STDOUT;

        fwrite($handle, $logline);
    }
239600
public function log($level, $message, array $context = array())
    {
        $allContext = array_merge($this->extraContext, $context);

        $this->logger->log($level, $message, $allContext);
    }
947455
public static function log($level, $message, array $context = array())
    {
        App::getBean('Logger')->log($level, $message, static::parseContext($context));
    }
113694
public function debug($value, array $context = array())
	{
		// If we were given anything other than a string,
		// we'll get readable format of the value.
		if( ! is_string($value))
		{
			$value = print_r($value, true);
		}

		$this->log(LogLevel::DEBUG, $value, $context);
	}
944988
public function notice($message, array $context = []): void {
        $this->log(LogLevel::NOTICE, $message, $context);
    }
346403
public function validate($string, $config, $context)
    {
        // test for ! and important tokens
        $string = trim($string);
        $is_important = false;
        // :TODO: optimization: test directly for !important and ! important
        if (strlen($string) >= 9 && substr($string, -9) === 'important') {
            $temp = rtrim(substr($string, 0, -9));
            // use a temp, because we might want to restore important
            if (strlen($temp) >= 1 && substr($temp, -1) === '!') {
                $string = rtrim(substr($temp, 0, -1));
                $is_important = true;
            }
        }
        $string = $this->def->validate($string, $config, $context);
        if ($this->allow && $is_important) {
            $string .= ' !important';
        }
        return $string;
    }
1344631
public function log($level, $message, array $context = array()) {
		$message = preg_replace("/[\r\n]+/", $this->replacement, $message);
		$this->logger()->log($level, $message, $context);
	}
805148
public function log($level, $message, array $context = array())
    {
        if ($this->logLevels[$this->logLevelThreshold] < $this->logLevels[$level]) {
            return;
        }
        $message = $this->formatMessage($level, $message, $context);
        $this->write($message);
    }