Skip to content

Commit

Permalink
Fix #131 by decreasing the level of some loggings
Browse files Browse the repository at this point in the history
  • Loading branch information
ljean committed Dec 8, 2020
1 parent c4a48aa commit 14c70f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modbus_tk/modbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ def _run_server(self):
self._do_init()
while self._go.isSet():
self._do_run()
LOGGER.info("%s has stopped", self.__class__)
LOGGER.debug("%s has stopped", self.__class__)
self._do_exit()
except Exception as excpt:
LOGGER.error("server error: %s", str(excpt))
Expand Down
4 changes: 2 additions & 2 deletions modbus_tk/modbus_rtu.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __init__(self, serial, interchar_multiplier=1.5, interframe_multiplier=3.5,
"""Constructor. Pass the pyserial.Serial object"""
self._serial = serial
self.use_sw_timeout = False
LOGGER.info("RtuMaster %s is %s", self._serial.name, "opened" if self._serial.is_open else "closed")
LOGGER.debug("RtuMaster %s is %s", self._serial.name, "opened" if self._serial.is_open else "closed")
super(RtuMaster, self).__init__(self._serial.timeout)

if t0:
Expand Down Expand Up @@ -186,7 +186,7 @@ def __init__(self, serial, databank=None, error_on_missing_slave=True, **kwargs)
super(RtuServer, self).__init__(databank)

self._serial = serial
LOGGER.info("RtuServer %s is %s", self._serial.name, "opened" if self._serial.is_open else "closed")
LOGGER.debug("RtuServer %s is %s", self._serial.name, "opened" if self._serial.is_open else "closed")

self._t0 = utils.calculate_rtu_inter_char(self._serial.baudrate)
self._serial.inter_byte_timeout = interchar_multiplier * self._t0
Expand Down
4 changes: 2 additions & 2 deletions modbus_tk/modbus_tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,13 @@ def _do_run(self):
# handle the server socket
client, address = self._sock.accept()
client.setblocking(0)
LOGGER.info("%s is connected with socket %d...", str(address), client.fileno())
LOGGER.debug("%s is connected with socket %d...", str(address), client.fileno())
self._sockets.append(client)
call_hooks("modbus_tcp.TcpServer.on_connect", (self, client, address))
else:
if len(sock.recv(1, socket.MSG_PEEK)) == 0:
# socket is disconnected
LOGGER.info("%d is disconnected" % (sock.fileno()))
LOGGER.debug("%d is disconnected" % (sock.fileno()))
call_hooks("modbus_tcp.TcpServer.on_disconnect", (self, sock))
sock.close()
self._sockets.remove(sock)
Expand Down

0 comments on commit 14c70f2

Please sign in to comment.