stream_task_logs#

MonitorApi.stream_task_logs(task_id, *, file_path=None, backlog=100, max_messages=None)#

Stream log file messages for a specific task.

Subscribes to messages tagged with task_id=<task_id> and client_type=ansys.rep.evaluator.file_tail, and yields each message as it arrives. Optionally narrows to a single file via file_path.

Return type:

Generator[MonitorMessage, None, None]

Parameters:
task_idstr

The task identifier to filter on.

file_pathstr, optional

Filename to restrict to a single tailed file, e.g. "console_output.txt". The default is None.

backlogint, optional

Number of historical messages to request on connect. The default is 100.

max_messagesint or None, optional

Maximum total messages to yield before closing the connection. The default is None, which streams indefinitely until interrupted or the server closes the connection.

Yields:
MonitorMessage

Parsed JSON message dicts from the server.