Remove password from logging

Remove cartridge returns form logging
This commit is contained in:
2020-01-21 17:14:10 +01:00
parent 3ea69b0ba2
commit 31b5f941fa

View File

@@ -137,7 +137,10 @@ send a sip command to the server
"""
if self._socket != None:
try:
self.log.debug("LmwSip.send(%s)" % sipcmd)
logcmd = sipcmd.strip('\r')
if re.match("^LI", logcmd, re.IGNORECASE):
logcmd = re.sub(",.*", ", ******", logcmd)
self.log.debug("LmwSip.send(%s)" % logcmd)
self._socket.sendall(sipcmd.encode('ascii'))
except Exception as e:
self.log.error("LmwSip.send(%s) failed: %s", sipcmd, e)
@@ -169,9 +172,9 @@ recieve a answer from the sip server
if self._socket == None:
self.log.warn("LmwSip.recv: No connection")
elif buf[0] != '!':
self.log.warn("LmwSip.recv: Sip error: %s" % buf)
self.log.warn("LmwSip.recv: Sip error: %s" % buf.strip('\r'))
else:
self.log.debug("LmwSip.recv: result: %s" % buf)
self.log.debug("LmwSip.recv: result: %s" % buf.strip('\r'))
return(buf)
def login(self):