. */ require_once 'phing/system/io/Writer.php'; require_once 'phing/Task.php'; /** * Extends the Writer class to output messages to Phing's log * * @author Michiel Rook * @version $Id: LogWriter.php 905 2010-10-05 16:28:03Z mrook $ * @package phing.util */ class LogWriter extends Writer { private $task = NULL; private $level = NULL; /** * Constructs a new LogWriter object */ function __construct(Task $task, $level = Project::MSG_INFO) { $this->task = $task; $this->level = $level; } /** * @see Writer::write() */ function write($buf, $off = null, $len = null) { $lines = explode("\n", $buf); foreach ($lines as $line) { if ($line == "") { continue; } $this->task->log($line, $this->level); } } /** * @see Writer::reset() */ function reset() { } /** * @see Writer::close() */ function close() { } /** * @see Writer::open() */ function open() { } /** * @see Writer::getResource() */ function getResource() { return $this->task; } }