Commit 9679721e by Carsten Brandt

fixes display of array log messages in debug toolbar

fixes #3244
parent efbd23b5
<?php <?php
use yii\helpers\Html; use yii\helpers\Html;
use yii\grid\GridView; use yii\grid\GridView;
use yii\helpers\VarDumper;
use yii\log\Logger; use yii\log\Logger;
?> ?>
...@@ -51,8 +52,7 @@ echo GridView::widget([ ...@@ -51,8 +52,7 @@ echo GridView::widget([
[ [
'attribute' => 'message', 'attribute' => 'message',
'value' => function ($data) { 'value' => function ($data) {
$message = nl2br(Html::encode($data['message'])); $message = Html::encode(is_string($data['message']) ? $data['message'] : VarDumper::export($data['message']));
if (!empty($data['trace'])) { if (!empty($data['trace'])) {
$message .= Html::ul($data['trace'], [ $message .= Html::ul($data['trace'], [
'class' => 'trace', 'class' => 'trace',
...@@ -61,7 +61,6 @@ echo GridView::widget([ ...@@ -61,7 +61,6 @@ echo GridView::widget([
} }
]); ]);
}; };
return $message; return $message;
}, },
'format' => 'html', 'format' => 'html',
......
...@@ -58,6 +58,7 @@ Yii Framework 2 Change Log ...@@ -58,6 +58,7 @@ Yii Framework 2 Change Log
- Enh #3222: Added `useTablePrefix` option to the model generator for Gii (horizons2) - Enh #3222: Added `useTablePrefix` option to the model generator for Gii (horizons2)
- Enh #3230: Added `yii\filters\AccessControl::user` to support access control with different actors (qiangxue) - Enh #3230: Added `yii\filters\AccessControl::user` to support access control with different actors (qiangxue)
- Enh #3232: Added `export()` and `exportAsString()` methods to `yii\helpers\BaseVarDumper` (klimov-paul) - Enh #3232: Added `export()` and `exportAsString()` methods to `yii\helpers\BaseVarDumper` (klimov-paul)
- Enh #3244: Allow logging complex data such as arrays and object via the log system (cebe)
- Enh #3252: Added support for case insensitive matching using ILIKE to PostgreSQL QueryBuilder (cebe) - Enh #3252: Added support for case insensitive matching using ILIKE to PostgreSQL QueryBuilder (cebe)
- Enh #3284: Added support for checking multiple ETags by `yii\filters\HttpCache` (qiangxue) - Enh #3284: Added support for checking multiple ETags by `yii\filters\HttpCache` (qiangxue)
- Enh #3298: Supported configuring `View::theme` using a class name (netyum, qiangxue) - Enh #3298: Supported configuring `View::theme` using a class name (netyum, qiangxue)
...@@ -105,6 +106,8 @@ Yii Framework 2 Change Log ...@@ -105,6 +106,8 @@ Yii Framework 2 Change Log
- Chg: `yii\data\ActiveDataProvider::$query` will not be modified directly with pagination and sorting anymore so it will be reuseable (cebe) - Chg: `yii\data\ActiveDataProvider::$query` will not be modified directly with pagination and sorting anymore so it will be reuseable (cebe)
- Chg: Removed `yii\rest\ActiveController::$transactional` property and connected functionality (samdark) - Chg: Removed `yii\rest\ActiveController::$transactional` property and connected functionality (samdark)
- Chg: Changed the default value of the `keyPrefix` property of cache components to be null (qiangxue) - Chg: Changed the default value of the `keyPrefix` property of cache components to be null (qiangxue)
- Chg: Added `prefix` column to `yii\log\DbTarget` to have the same amount of information logged as in files and emails (cebe)
2.0.0-beta April 13, 2014 2.0.0-beta April 13, 2014
------------------------- -------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment