yaml_workflow.tasks.base¶
yaml_workflow.tasks.base
¶
Base functionality for task handlers.
Functions¶
get_task_logger(workspace: Union[str, Path], task_name: str) -> logging.Logger
¶
Get a logger for a task that logs to the workspace logs directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace
|
Union[str, Path]
|
Workspace directory (can be string or Path) |
required |
task_name
|
str
|
Name of the task |
required |
Returns:
Type | Description |
---|---|
Logger
|
logging.Logger: Configured logger |
Source code in src/yaml_workflow/tasks/base.py
log_task_error(logger: logging.Logger, error: Exception) -> None
¶
Log task execution error.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
logger
|
Logger
|
Task logger |
required |
error
|
Exception
|
Exception that occurred |
required |
log_task_execution(logger: logging.Logger, step: Dict[str, Any], context: Dict[str, Any], workspace: Path) -> None
¶
Log task execution details.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
logger
|
Logger
|
Task logger |
required |
step
|
Dict[str, Any]
|
Step configuration |
required |
context
|
Dict[str, Any]
|
Workflow context |
required |
workspace
|
Path
|
Workspace directory |
required |
Source code in src/yaml_workflow/tasks/base.py
log_task_result(logger: logging.Logger, result: Any) -> None
¶
Log task execution result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
logger
|
Logger
|
Task logger |
required |
result
|
Any
|
Task result |
required |