47 foreach ($records as $key => $record) {
48 $records[$key] = $this->
format($record);
56 if ($this->maxNestingLevel == 0 || $nestingLevel <= $this->maxNestingLevel) {
57 foreach ($record as $name => $value) {
58 if ($value instanceof \DateTime) {
59 $record[$name] = $this->
formatDate($value, $nestingLevel + 1);
62 } elseif (is_array($value)) {
63 $record[$name] = $this->
formatArray($value, $nestingLevel + 1);
64 } elseif (is_object($value)) {
65 $record[$name] = $this->
formatObject($value, $nestingLevel + 1);
77 $objectVars = get_object_vars($value);
78 $objectVars[
'class'] = get_class($value);
80 return $this->
formatArray($objectVars, $nestingLevel);
85 $formattedException =
array(
86 'class' => get_class($exception),
87 'message' => $exception->getMessage(),
88 'code' => $exception->getCode(),
89 'file' => $exception->getFile() .
':' . $exception->getLine(),
92 if ($this->exceptionTraceAsString ===
true) {
93 $formattedException[
'trace'] = $exception->getTraceAsString();
95 $formattedException[
'trace'] = $exception->getTrace();
98 return $this->
formatArray($formattedException, $nestingLevel);
101 protected function formatDate(\DateTime $value, $nestingLevel)
103 return new \MongoDate($value->getTimestamp());
Create styles array
The data for the language used.