Get a Monolog formatter instance.

@return \Monolog\Formatter\FormatterInterface
11112
protected function formatter()
    {
        $formatter = new LineFormatter(null, null, true, true);
        $formatter->includeStacktraces();

        return $formatter;
    }
1184285
protected function formatter()
    {
        $key = $this->getLocalesKey(
            $locale = $this->getLocale(),
            $fallbackLocale = $this->getFallbackLocale()
        );

        if (! isset($this->formatters[$key])) {
            $this->formatters[$key] = new NumberFormatter(new NumberFormatRepository($fallbackLocale), ['locale' => $locale]);
        }

        return $this->formatters[$key];
    }
389505
public function getLogger(): LoggerInterface
    {
        if ($this->logger === null) {
            $this->setLogger(new NullLogger());
        }
        assert($this->logger instanceof LoggerInterface);
        return $this->logger;
    }
1118129
private function loadFrontLogger(Logger $monolog)
    {
        $whoops = new \Whoops\Run;

        if (app_env('APP_ENV') == 'development') {
            $whoops->pushHandler(
                new \Whoops\Handler\PrettyPageHandler
            );
        }

        if (class_exists(\App\ErrorHandle::class)) {
            $handler = new \Whoops\Handler\CallbackHandler(
                function ($exception, $inspector, $run) use ($monolog) {
                    $monolog->error($exception->getMessage(), $exception->getTrace());

                    return call_user_func_array(
                        [new \App\ErrorHandle, 'handle'],
                        [$exception]
                    );
                }
            );

            $whoops->pushHandler($handler);
        }

        $whoops->register();
    }
1049753
protected function getDefaultFormatter()
    {
        $allowLinebreaks = $this->configuration
            ->get('log_allow_line_breaks')
        ;

        return new LineFormatter(
            null,
            null,
            $allowLinebreaks,
            false
        );
    }
1145874
public function getOutfile()
    {
        if ($this->outfile) {
            return $this->outfile;
        } else {
            return $this->formatter->getPreferredOutfile() . $this->getExtension();
        }
    }
454477
public function getFormatter(string $id)
    {
        if (!isset($this->_formatters[$id])) {
            throw new \RuntimeException('Formatter with ID "'.$id.'" is not registered on the logger factory.');
        }

        return $this->_formatters[$id];
    }
318207
public function getLoggingFormatter()
    {
        if (null === $this->loggingFormatter) {
            @trigger_error(sprintf('The %s() method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the ContainerBuilder::log() method instead.', __METHOD__), E_USER_DEPRECATED);

            $this->loggingFormatter = new LoggingFormatter();
        }

        return $this->loggingFormatter;
    }
321584
protected function formatter()
    {
        $key = $this->getLocalesKey(
            $locale = $this->getLocale(),
            $fallbackLocale = $this->getFallbackLocale()
        );

        if (! isset($this->formatters[$key])) {
            $this->formatters[$key] = new CurrencyFormatter(
                new NumberFormatRepository($fallbackLocale),
                $this->data(),
                ['locale' => $locale]
            );
        }

        return $this->formatters[$key];
    }
904294
public function getFormatter($name)
    {
        $formatters = $this->getFormatters();
        if (!array_key_exists($name, $formatters)) {
            list($module, $exporter) = explode('-', $name, 2);
            $class = sprintf('\\MwbExporter\\Formatter\\%s\\%s\\Formatter', ucfirst(strtolower($module)), ucfirst(strtolower($exporter)));
            if (!class_exists($class)) {
                throw new \InvalidArgumentException(sprintf('Unknown formatter "%s".', $name));
            }
        } else {
            $class = $formatters[$name];
        }

        return new $class($name);
    }
1103485
public function parse()
	{
		if (is_object($this->record->context))
		{
			$this->record->formatted = str_replace("{log-context}", print_r($this->record->context, 1), $this->record->formatted);
		}
		return $this->record;
	}
535699
public function parse()
	{
		if (is_string($this->record->context))
			$this->record->formatted = str_replace("{log-context}", $this->record->context, $this->record->formatted);

		return $this->record;
	}
944660
public function getLineFormatter()
    {
        $formatter = function($line) {
            $line['online'] = $this->isOnline($line['lastActivity']);
            $line['intervalLastLogin'] = $this->getIntervalLastLogin($line['lastLogin']);
            $line['lastActivity'] = '';
            return $line;
        };
        
        return $formatter;
    }
688427
public function parse()
	{
		if (is_resource($this->record->context))
		{
			$this->record->formatted = str_replace("{log-context}", "Resource type: " . get_resource_type($this->record->context), $this->record->formatted);
		}

		return $this->record;
	}
699697
protected function getHandler(): HandlerInterface
	{
		$handler = new StreamHandler($this->app->getPath() . '/storage/logs/' . date('Y-m-d') . '.mako');

		$formatter = new LineFormatter(null, null, true, true);

		$formatter->includeStacktraces();

		$handler->setFormatter($formatter);

		return $handler;
	}
133053
protected function getTransformer()
    {
        if (is_callable($this->transformer) || $this->transformer instanceof TransformerAbstract) {
            return $this->transformer;
        }

        return Craft::createObject($this->transformer);
    }
70982
public function getLogBuilder()
    {
        if (!is_object($this->_logBuilder)) {
            $this->_logBuilder = Yii::createObject($this->_logBuilder);
        }
        return $this->_logBuilder;
    }