src/Tasks/Engines/BaseRunner.php
protected function writeLogLine($line, $prefix = null)
    {
        if (!$prefix) {
            $prefix = '[' . DBDatetime::now()->Rfc2822() . '] ';
        }

        if (Director::is_cli()) {
            echo $prefix . $line . "\n";
        } else {
            echo Convert::raw2xml($prefix . $line) . "<br>";
        }
    }
protected function writeLogLine($line, $prefix = null)
    {
        if (!$prefix) {
            $prefix = '[' . DBDatetime::now()->Rfc2822() . '] ';
        }

        if (Director::is_cli()) {
            echo $prefix . $line . "\n";
        } else {
            echo Convert::raw2xml($prefix . $line) . "<br>";
        }
    }
Write in a format expected by the output medium (CLI/HTML).

@param string $line Line to be written out, without the newline character.
@param null|string $prefix