Add an option to log result from the Agent
# What does this PR do?

This PR makes it possible to customize how results of the agent are displayed (default is using `print`) by adding a `set_stream` method.

Should address #23354
_The documentation is not available anymore as the PR was closed or merged._