Improved logs

This commit is contained in:
Daniil Gentili 2019-06-17 12:42:42 +02:00
parent 8cd870366a
commit 31fb37d39c
2 changed files with 6 additions and 1 deletions

View File

@ -103,7 +103,7 @@ trait CallHandler
$this->wrapper->serialize($this->wrapper->session);
}
if (isset($aargs['file']) && $aargs['file'] && isset($this->datacenter->sockets[$aargs['datacenter'].'_media'])) {
\danog\MadelineProto\Logger::log('Using media DC');
$this->logger->logger('Using media DC');
$aargs['datacenter'] .= '_media';
}
if (in_array($method, ['messages.setEncryptedTyping', 'messages.readEncryptedHistory', 'messages.sendEncrypted', 'messages.sendEncryptedFile', 'messages.sendEncryptedService', 'messages.receivedQueue'])) {

View File

@ -46,6 +46,11 @@ trait Loop
return yield $max_forks;
}
if (!$this->authorized) {
$this->logger->logger('Not authorized, not starting event loop', \danog\MadelineProto\Logger::FATAL_ERROR);
return false;
}
if (in_array($this->settings['updates']['callback'], [['danog\\MadelineProto\\API', 'get_updates_update_handler'], 'get_updates_update_handler'])) {
$this->logger->logger('Getupdates event handler is enabled, exiting from loop', \danog\MadelineProto\Logger::FATAL_ERROR);