Dumper
Monitor events.
Attributes
| Attribute | Type | Description |
|---|---|---|
| out | file-like object = sys.stdout | The output stream where event logs and messages are written, defaulting to standard output. |
Constructor
Signature
def Dumper(
out: file-like object = sys.stdout
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| out | file-like object = sys.stdout | The output stream where events will be written. |
Signature
def Dumper(
out: file-like object = sys.stdout
)
Parameters
| Name | Type | Description |
|---|---|---|
| out | file-like object = sys.stdout | The output stream where event logs and messages will be written, defaulting to standard output. |
Methods
say()
@classmethod
def say(
msg: string
)
Writes a message to the configured output stream and flushes the buffer to ensure the output is immediately available for piping.
Parameters
| Name | Type | Description |
|---|---|---|
| msg | string | The text message or log entry to be written to the output stream. |
on_event()
@classmethod
def on_event(
ev: dict
) - > string|null
Processes an incoming event dictionary, updating internal task tracking and routing the data to the appropriate formatter for output.
Parameters
| Name | Type | Description |
|---|---|---|
| ev | dict | The raw event data containing a timestamp, event type, hostname, and associated metadata. |
Returns
| Type | Description |
|---|---|
| `string | null` |
format_task_event()
@classmethod
def format_task_event(
hostname: string,
timestamp: datetime,
type: string,
task: string,
event: dict
)
Formats and outputs task-specific event data including the hostname, timestamp, task identity, and additional event fields.
Parameters
| Name | Type | Description |
|---|---|---|
| hostname | string | The name of the host where the task event originated. |
| timestamp | datetime | The UTC timestamp representing when the event occurred. |
| type | string | The specific type of task event, such as 'task-received' or 'task-started'. |
| task | string | The formatted task string containing the task name, UUID, and arguments. |
| event | dict | A dictionary of remaining metadata fields to be serialized into the output. |