diff options
-rwxr-xr-x | src/Logger.php | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/Logger.php b/src/Logger.php index d007b0c..7a10775 100755 --- a/src/Logger.php +++ b/src/Logger.php @@ -200,18 +200,21 @@ class Logger extends AbstractLogger */
private function contextToString($context)
{
- $export = var_export($context, true);
-
- // var_export is ugly, let's pretty it up a bit.
- return preg_replace(array(
- '/=>\s+([a-zA-Z])/im',
- '/array\(\s+\)/im',
- '/^ |\G /m',
- ), array(
- '=> $1',
- 'array()',
- ' ',
- ), str_replace('array (', 'array(', $export));
+ $export = '';
+ foreach ($context as $key => $value) {
+ $export .= "{$key}: ";
+ $export .= preg_replace(array(
+ '/=>\s+([a-zA-Z])/im',
+ '/array\(\s+\)/im',
+ '/^ |\G /m',
+ ), array(
+ '=> $1',
+ 'array()',
+ ' ',
+ ), str_replace('array (', 'array(', var_export($value, true)));
+ $export .= PHP_EOL;
+ }
+ return str_replace('\\\\', '\\', $export);
}
/**
|