Automatically add new line
!!! ATTENTION !!! This works only in TYPO3 12 !!!
Add new feature to automatically add a new line in function "writeLog", this behaviour can be easily toggled depending on use case:
new function call:
public function writeLog(array|string $msg, bool $newLine = TRUE)
...
if (is_string($msg)) {
fwrite($this->fileWriter, $this->timestamp . ": " . $msg);
$this->addNewLine($newLine);
} elseif (is_array($msg)) {
fwrite($this->fileWriter, $this->timestamp . ": " . print_r($msg, true));
$this->addNewLine($newLine);
...
private function addNewLine(bool $newLine)
{
if($newLine)
fwrite($this->fileWriter, "\n");
}