Skip to content

Commit 3582b1d

Browse files
committed
improving some logging
1 parent 15d23ae commit 3582b1d

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/Util/YamlSourceManipulator.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -814,14 +814,7 @@ private function advanceCurrentPosition(int $newPosition)
814814
}
815815
}
816816

817-
/*
818-
if ($newIndentation === $previousIndentation) {
819-
$this->log(sprintf('Indentation unchanged: %d', $newIndentation));
820-
} else {
821-
$this->log(sprintf('Indentation changed to: %d', $newIndentation));
822-
}
823-
*/
824-
817+
$this->log(sprintf('Calculating new indentation: changing from %d to %d', $this->indentationForDepths[$this->depth], $newIndentation), true);
825818
$this->indentationForDepths[$this->depth] = $newIndentation;
826819
}
827820

@@ -850,12 +843,13 @@ private function log(string $message, $includeContent = false)
850843
'key' => isset($this->currentPath[$this->depth]) ? $this->currentPath[$this->depth] : 'n/a',
851844
'depth' => $this->depth,
852845
'position' => $this->currentPosition,
846+
'indentation' => $this->indentationForDepths[$this->depth],
853847
];
854848

855849
if ($includeContent) {
856850
$context['content'] = sprintf(
857-
'%s...',
858-
str_replace(["\r\n", "\n"], ['\r\n', '\n'], substr($this->contents, $this->currentPosition, 20))
851+
'>%s<',
852+
str_replace(["\r\n", "\n"], ['\r\n', '\n'], substr($this->contents, $this->currentPosition, 50))
859853
);
860854
}
861855

0 commit comments

Comments
 (0)