Common utilities for Dora nodes in MoFA Studio.
This package provides shared utilities used across multiple Dora nodes, ensuring consistent logging and status reporting throughout the voice chat pipeline.
pip install -e libs/dora-commonfrom dora_common.logging import send_log, get_log_level_from_env
# Get log level from environment
log_level = get_log_level_from_env() # reads LOG_LEVEL env var, defaults to "INFO"
# Send log messages
send_log(node, "INFO", "Processing started", config_level=log_level)
send_log(node, "DEBUG", "Detailed debug info", config_level=log_level)
send_log(node, "ERROR", "Something went wrong", config_level=log_level)from dora_common.logging import send_status
# Send status updates
send_status(node, "ready")
send_status(node, "processing", details={"progress": 50})
send_status(node, "error", details={"error": "Connection failed"})Send log message through the log output channel.
Parameters:
node: Dora node instancelevel: Log level (DEBUG,INFO,WARNING,ERROR)message: Log message stringnode_name: Optional node name (auto-detected if not provided)config_level: Minimum log level to output (default:INFO)
Send status message through the status output channel.
Parameters:
node: Dora node instancestatus: Status stringdetails: Optional dict with additional status detailsnode_name: Optional node name (auto-detected if not provided)
Get log level from environment variable.
Parameters:
env_var: Environment variable name (default:LOG_LEVEL)default: Default log level if env var not set (default:INFO)
Returns: Log level string (uppercase)
| Level | Value | Description |
|---|---|---|
| DEBUG | 10 | Detailed debug information |
| INFO | 20 | General information |
| WARNING | 30 | Warning messages |
| ERROR | 40 | Error messages |
dora-rs>=0.3.7pyarrow>=10.0.0