Download xirelogy / magpie-core / SimpleConsoleLogStringFormat.php - Solve class 'SimpleConsoleLogStringFormat' not found
This file is part of the package xirelogy/magpie-core.
Please go to our download page to download this composer package and to solve the problem class 'SimpleConsoleLogStringFormat' not found.
Download xirelogy/magpie-core
Class is not correct?
Search class SimpleConsoleLogStringFormat
<?php
namespace Magpie\Logs\Formats;
use Magpie\General\Str;
use Magpie\Logs\LogConfig;
use Magpie\Logs\LogEntry;
/**
* Simple implementation of `LogStringFormattable` for console output
*/
class SimpleConsoleLogStringFormat extends CommonLogStringFormat
{
/**
* @inheritDoc
*/
public function format(LogEntry $entry, LogConfig $config) : string
{
$source = $entry->source ?? $config->defaultSource;
$message = $entry->message;
if (Str::isNullOrEmpty($source)) {
$ret = $message;
} else {
$ret = "[$source] $message";
}
if (count($entry->context) > 0) {
$flattenContext = $this->flattenContext($entry->context);
$ret .= " $flattenContext";
}
return static::normalize($ret);
}
}