def emit(self, value):
    """Emits a value to output writer.

    Args:
      value: a value of type expected by the output writer.
    """
    if not self._tstate.output_writer:
      logging.error("emit is called, but no output writer is set.")
      return
    self._tstate.output_writer.write(value)