Skip to content

unnecessary warnings #110

@hartytp

Description

@hartytp

Currently, a warning is generated whenever an exception is raised in a future on Windows

self._logger.warning('Event callback failed', exc_info=sys.exc_info())
Since many (most?) in exceptions aren't really exceptional at all, this can lead to a lot of unwanted noise in the logs, obscuring more important warnings.

Can we downgrade this to a debug message?

e.g. consider something like

while True:
    # try to connect to server
    while True:
        try:
            self.reader, self.writer = \
                await asyncio.open_connection(host, port)
                break
        except ConnetionError:
            # server isn't ready yet, retry in 10s
            await asyncio.sleep(10)
    
    while True:
        try:
            line = await self.reader.readline()
            # do something
        except ConnectionError:
            # server down, try to reconnect
            break

All exceptions here are caught and handled, so there is nothing that warrants quamash generating a warning in the log (it should be up to the user to log server disconnects if they feel it's worth it).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions