From 707d9e96fdc3ffdfdbaa920af1dd8e9d47be4b27 Mon Sep 17 00:00:00 2001 From: felix <madwang@tencent.com> Date: Tue, 15 Oct 2019 14:20:44 +0800 Subject: [PATCH] fix(service-logging): show socket creating --- gnes/service/base.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gnes/service/base.py b/gnes/service/base.py index c9dcec75..bc12f7af 100644 --- a/gnes/service/base.py +++ b/gnes/service/base.py @@ -403,15 +403,19 @@ def _run(self, ctx): self.logger.info('bind sockets...') in_sock, _ = build_socket(ctx, self.args.host_in, self.args.port_in, self.args.socket_in, self.args.identity) + self.logger.info('input %s:%s' % (self.args.host_in, colored(self.args.port_in, 'yellow'))) + out_sock, _ = build_socket(ctx, self.args.host_out, self.args.port_out, self.args.socket_out, self.args.identity) - ctrl_sock, ctrl_addr = build_socket(ctx, self.default_host, self.args.port_ctrl, SocketType.PAIR_BIND) + self.logger.info('output %s:%s' % (self.args.host_out, colored(self.args.port_out, 'yellow'))) - self.logger.info( - 'input %s:%s\t output %s:%s\t control over %s' % ( - self.args.host_in, colored(self.args.port_in, 'yellow'), - self.args.host_out, colored(self.args.port_out, 'yellow'), - colored(ctrl_addr, 'yellow'))) + ctrl_sock, ctrl_addr = build_socket(ctx, self.default_host, self.args.port_ctrl, SocketType.PAIR_BIND) + self.logger.info('control over %s' % (colored(ctrl_addr, 'yellow'))) + # self.logger.info( + # 'input %s:%s\t output %s:%s\t control over %s' % ( + # self.args.host_in, colored(self.args.port_in, 'yellow'), + # self.args.host_out, colored(self.args.port_out, 'yellow'), + # colored(ctrl_addr, 'yellow'))) poller = zmq.Poller() poller.register(in_sock, zmq.POLLIN)