* channel as the prefix value.
*
* When not targeting a udp2log stream this class will act as a drop-in
- * replacement for \\Monolog\\Handler\\StreamHandler.
+ * replacement for \Monolog\Handler\StreamHandler.
*
* @since 1.25
- * @author Bryan Davis <bd808@wikimedia.org>
- * @copyright © 2013 Bryan Davis and Wikimedia Foundation.
+ * @copyright © 2013 Wikimedia Foundation and contributors
*/
class LegacyHandler extends AbstractProcessingHandler {
*/
protected $prefix;
-
/**
* @param string $stream Stream URI
* @param bool $useLegacyFilter Filter log events using legacy rules
'Missing stream uri, the stream can not be opened.' );
}
$this->error = null;
- set_error_handler( array( $this, 'errorTrap' ) );
+ set_error_handler( [ $this, 'errorTrap' ] );
if ( substr( $this->uri, 0, 4 ) == 'udp:' ) {
$parsed = parse_url( $this->uri );
}
}
-
/**
* Custom error handler.
* @param int $code Error number
$this->error = $msg;
}
-
/**
* Should we use UDP to send messages to the sink?
* @return bool
return $this->host !== null;
}
-
protected function write( array $record ) {
if ( $this->useLegacyFilter &&
!LegacyLogger::shouldEmit(
}
}
-
public function close() {
if ( is_resource( $this->sink ) ) {
if ( $this->useUdp() ) {