From 4de203a81c02068ba3579372cb3378f4281b581b Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Tue, 13 Aug 2019 13:18:51 +0200 Subject: [PATCH] Add information about test/production servers when logging connections --- pyrogram/connection/connection.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyrogram/connection/connection.py b/pyrogram/connection/connection.py index 0c325fae..cc1d4e03 100644 --- a/pyrogram/connection/connection.py +++ b/pyrogram/connection/connection.py @@ -39,6 +39,7 @@ class Connection: def __init__(self, dc_id: int, test_mode: bool, ipv6: bool, proxy: dict, mode: int = 3): self.dc_id = dc_id + self.test_mode = test_mode self.ipv6 = ipv6 self.proxy = proxy self.address = DataCenter(dc_id, test_mode, ipv6) @@ -59,7 +60,8 @@ class Connection: self.connection.close() time.sleep(1) else: - log.info("Connected! DC{} - IPv{} - {}".format( + log.info("Connected! {} DC{} - IPv{} - {}".format( + "Test" if self.test_mode else "Production", self.dc_id, "6" if self.ipv6 else "4", self.mode.__name__