/** * Create a logger that outputs to the specified stream resource * @param resource $stream */ public function __construct($stream) { if (!is_resource($stream) || get_resource_type($stream) != 'stream') { throw new Exception('Not a valid stream: ' . gettype($stream)); } $this->stream = $stream; parent::__construct(); }
/** * Create a syslogger. * @param string $prefix value prefixed to all message. */ public function __construct($prefix = '') { parent::__construct(); $prefix = trim($prefix); $this->prefix = $prefix ? $prefix . ': ' : ''; }