Skip to content

Commit

Permalink
Merge pull request #8 from padlyuck/patch-1
Browse files Browse the repository at this point in the history
more pretty dump
  • Loading branch information
pahanini authored Jan 23, 2018
2 parents 99feeb0 + c58e7ad commit ddc01a3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ConsoleTarget.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,13 @@ private function generateLabel($message)
private function generateText($message)
{
$text = $message[0];
if (is_array($text) || is_object($text)) {
$text = "Array content is \n\r".json_encode($text, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
} elseif (!is_string($text)) {
$text = 'Message is ' . gettype($text);
if (!is_string($text)) {
// exceptions may not be serializable if in the call stack somewhere is a Closure
if ($text instanceof \Throwable || $text instanceof \Exception) {
$text = (string) $text;
} else {
$text = VarDumper::export($text);
}
}
return $text;
}
Expand Down

0 comments on commit ddc01a3

Please sign in to comment.