perf: gateway print (#9398)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2023-02-01 19:02:41 +08:00
committed by GitHub
parent 9d898f0aec
commit 758d6ae81b

View File

@@ -33,7 +33,7 @@ class PingGatewayManager:
err = _('No account') err = _('No account')
return False, err return False, err
logger.debug('Test account: {}'.format(account)) print('Test account: {}'.format(account))
try: try:
proxy.connect( proxy.connect(
gateway.address, gateway.address,
@@ -91,7 +91,7 @@ class PingGatewayManager:
@staticmethod @staticmethod
def on_host_success(gateway, account): def on_host_success(gateway, account):
logger.info('\033[32m {} -> {}\033[0m\n'.format(gateway, account)) print('\033[32m {} -> {}\033[0m\n'.format(gateway, account))
gateway.set_connectivity(Connectivity.OK) gateway.set_connectivity(Connectivity.OK)
if not account: if not account:
return return
@@ -99,7 +99,7 @@ class PingGatewayManager:
@staticmethod @staticmethod
def on_host_error(gateway, account, error): def on_host_error(gateway, account, error):
logger.info('\033[31m {} -> {} 原因: {} \033[0m\n'.format(gateway, account, error)) print('\033[31m {} -> {} 原因: {} \033[0m\n'.format(gateway, account, error))
gateway.set_connectivity(Connectivity.ERR) gateway.set_connectivity(Connectivity.ERR)
if not account: if not account:
return return
@@ -107,7 +107,7 @@ class PingGatewayManager:
@staticmethod @staticmethod
def before_runner_start(): def before_runner_start():
logger.info(">>> 开始执行测试网关可连接性任务") print(">>> 开始执行测试网关可连接性任务")
def get_accounts(self, gateway): def get_accounts(self, gateway):
account = gateway.select_account account = gateway.select_account