@ -65,6 +65,10 @@ Stream, Side & Protocol
.. autoclass:: Stream
:members:
.. currentmodule:: mitogen.core
.. autoclass:: BufferedWriter
.. autoclass:: Side
@ -81,6 +85,10 @@ Stream, Side & Protocol
.. autoclass:: DelimitedProtocol
.. currentmodule:: mitogen.parent
.. autoclass:: LogProtocol
.. autoclass:: IoLoggerProtocol
@ -2727,9 +2727,9 @@ class Latch(object):
class Waker(Protocol):
"""
:class:`BasicStream` subclass implementing the `UNIX self-pipe trick`_.
Used to wake the multiplexer when another thread needs to modify its state
(via a cross-thread function call).
:class:`Protocol` implementing the `UNIX self-pipe trick`_. Used to wake
:class:`Broker` when another thread needs to modify its state, by enqueing
a function call to run on the :class:`Broker` thread.
.. _UNIX self-pipe trick: https://cr.yp.to/docs/selfpipe.html
@ -1250,6 +1250,9 @@ class LogProtocol(LineLoggingProtocolMixin, mitogen.core.DelimitedProtocol):
written to it.
def on_line_received(self, line):
Read a line, decode it as UTF-8, and log it.
super(LogProtocol, self).on_line_received(line)
LOG.info(u'%s: %s', self.stream.name, line.decode('utf-8', 'replace'))