Use LoggerAwareTrait
This commit is contained in:
@ -6,6 +6,7 @@ namespace Nsq;
|
|||||||
|
|
||||||
use Composer\InstalledVersions;
|
use Composer\InstalledVersions;
|
||||||
use PHPinnacle\Buffer\ByteBuffer;
|
use PHPinnacle\Buffer\ByteBuffer;
|
||||||
|
use Psr\Log\LoggerAwareTrait;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Psr\Log\NullLogger;
|
use Psr\Log\NullLogger;
|
||||||
use Socket\Raw\Factory;
|
use Socket\Raw\Factory;
|
||||||
@ -22,14 +23,14 @@ use const PHP_EOL;
|
|||||||
*/
|
*/
|
||||||
abstract class Connection
|
abstract class Connection
|
||||||
{
|
{
|
||||||
|
use LoggerAwareTrait;
|
||||||
|
|
||||||
private string $address;
|
private string $address;
|
||||||
|
|
||||||
private ?Socket $socket = null;
|
private ?Socket $socket = null;
|
||||||
|
|
||||||
private bool $closed = false;
|
private bool $closed = false;
|
||||||
|
|
||||||
private LoggerInterface $logger;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array{
|
* @var array{
|
||||||
* client_id: string,
|
* client_id: string,
|
||||||
@ -42,12 +43,12 @@ abstract class Connection
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
string $address,
|
string $address,
|
||||||
LoggerInterface $logger = null,
|
|
||||||
string $clientId = null,
|
string $clientId = null,
|
||||||
string $hostname = null,
|
string $hostname = null,
|
||||||
string $userAgent = null,
|
string $userAgent = null,
|
||||||
int $heartbeatInterval = null,
|
int $heartbeatInterval = null,
|
||||||
int $sampleRate = 0,
|
int $sampleRate = 0,
|
||||||
|
LoggerInterface $logger = null,
|
||||||
) {
|
) {
|
||||||
$this->address = $address;
|
$this->address = $address;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user