Output
provide.foundation.console.output
¶
TODO: Add module docstring.
Classes¶
Functions¶
perr
¶
Output message to stderr.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
Any
|
Content to output (any type - will be stringified or JSON-encoded) |
required |
**kwargs
|
Any
|
Optional formatting arguments: color: Color name (red, green, yellow, blue, cyan, magenta, white) bold: Bold text dim: Dim text nl/newline: Add newline (default: True) json_key: Key for JSON output mode prefix: Optional prefix string ctx: Override context |
{}
|
Examples:
perr("Error occurred") perr("Warning", color="yellow") perr({"error": details}, json_key="error")
Source code in provide/foundation/console/output.py
pout
¶
Output message to stdout.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message
|
Any
|
Content to output (any type - will be stringified or JSON-encoded) |
required |
**kwargs
|
Any
|
Optional formatting arguments: color: Color name (red, green, yellow, blue, cyan, magenta, white) bold: Bold text dim: Dim text nl/newline: Add newline (default: True) json_key: Key for JSON output mode prefix: Optional prefix string ctx: Override context |
{}
|
Examples:
pout("Hello world") pout({"data": "value"}) # Auto-JSON if dict/list pout("Success", color="green", bold=True) pout(results, json_key="results")