Skip to content

StreamRpcChannel uses root logger #1412

Description

@shenghaoyang

Hello,

I've been trying to use the python library to access OLA without using the wrapper class (so I can integrate the client into my own event loop).

While going over the source code to figure out how the client works, I've found multiple logging calls that send log messages straight to the root logger in ola/python/ola/rpc/StreamRpcChannel.py.

Example:

  def SocketReady(self):
    """Read data from the socket and handle when we get a full message.
    Returns:
      True if the socket remains connected, False if it was closed.
    """
    data = self._socket.recv(self.RECEIVE_BUFFER_SIZE)
    if data == '':
      logging.info('OLAD Server Socket closed')
      if self._close_callback is not None:

Is this intentional? There's no clean way to prevent the OLA library from polluting the logs with its own messages, because OLA does not source a logger for itself. I could source my own logger for the main application and change the handler for the root logger to the null handler, but I don't think OLA should be directly logging to the root logger in the first place.

Regards,

Shenghao Yang

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions