Skip to content

Commit

Permalink
👽 adapt logs to avoid logging sensitive data
Browse files Browse the repository at this point in the history
  • Loading branch information
Mips2648 committed Jun 27, 2024
1 parent 3b9c542 commit e83995f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions jeedomdaemon/aio_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ async def listen(self):
self._logger.info("Listening cancelled")

async def __handle_read(self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter):
self._logger.debug("Received new message on socket")
data = await reader.read()
message = data.decode()
addr = writer.get_extra_info('peername')
self._logger.debug("Received %s from %s", message, addr)

# addr = writer.get_extra_info('peername')
# self._logger.debug("Received %s from %s", message, addr)
writer.close()
self._logger.debug("Close connection")
await writer.wait_closed()
Expand Down
4 changes: 3 additions & 1 deletion jeedomdaemon/base_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async def stop(self):
await self.__on_stop_cb()

tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()]
self._logger.info("Cancelling %i outstanding tasks", len(tasks))
self._logger.info("Cancelling %i tasks", len(tasks))
for task in tasks:
task.cancel()
try:
Expand All @@ -153,6 +153,8 @@ async def __on_socket_message(self, message):
try:
if self.__on_message_cb is not None:
await self.__on_message_cb(message)
else:
self._logger.warning('Message received on socket but no callback defined')

except Exception as e: # pylint: disable=broad-exception-caught
self._logger.error('Send command to demon error: %s', e)
Expand Down

0 comments on commit e83995f

Please sign in to comment.