Cml\Logger\Base::format PHP Method

format() public method

格式化日志
public format ( string $message, array $context = [] ) : string
$message string 要记录到log的信息
$context array 上下文信息
return string
    public function format($message, array $context = [])
    {
        return '[' . date('Y-m-d H:i:s') . '] ' . Config::get('log_prefix', 'cml_log') . ': ' . $message . ' ' . json_encode($context, PHP_VERSION >= '5.4.0' ? JSON_UNESCAPED_UNICODE : 0);
    }