public function __construct() { if (!defined('STDOUT')) { throw new Exception('STDOUT stream not available'); } parent::__construct(STDOUT); }
/** * Open a file on the filesystem. * @param string $file full path and file name of target file */ public function __construct($file) { if (!$file) { throw new \InvalidArgumentException('No file specified'); } elseif (!($stream = fopen($file, 'a+'))) { throw new Exception("Unable to open log file: {$file}"); } parent::__construct($stream); }