More logs

This commit is contained in:
Daniil Gentili 2020-01-31 21:21:52 +01:00
parent 80aebfa359
commit c5789f38bb
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 2 additions and 1 deletions

View File

@ -330,6 +330,7 @@ class Connection extends Session
$this->API->logger->logger("Connecting to DC {$this->datacenterId}", \danog\MadelineProto\Logger::WARNING);
$ctx->setReadCallback([$this, 'haveRead']);
$this->stream = (yield from $ctx->getStream());
$this->API->logger->logger("Connected to DC {$this->datacenterId}!", \danog\MadelineProto\Logger::WARNING);
if ($this->needsReconnect) {
$this->needsReconnect = false;
}

View File

@ -251,7 +251,7 @@ class DataCenter
if (\MADELINEPROTO_TEST === 'pony') {
throw $e;
}
$this->API->logger->logger('Connection failed: ' . $e->getMessage(), \danog\MadelineProto\Logger::ERROR);
$this->API->logger->logger("Connection failed ({$dc_number}): " . $e->getMessage(), \danog\MadelineProto\Logger::ERROR);
}
}
throw new \danog\MadelineProto\Exception("Could not connect to DC {$dc_number}");