Files
chenlin c32df70326
Checks / Layout, translation and Colab checks (push) Has been cancelled
Checks / Ruff (push) Has been cancelled
Checks / Framework tests (native backend, CPU) (push) Has been cancelled
Checks / Portable Rust controller (push) Has been cancelled
release: v0.1 generic robot training and application platform
2026-11-05 11:05:01 +08:00

26 lines
583 B
Python

"""Logging utilities for colored terminal output."""
import sys
def print_info(message: str, color: str = "green") -> None:
"""Print information message with color.
Args:
message: The message to print.
color: Color name ('green', 'red', 'yellow', 'blue', 'cyan', 'magenta').
"""
colors = {
"green": "\033[92m",
"red": "\033[91m",
"yellow": "\033[93m",
"blue": "\033[94m",
"cyan": "\033[96m",
"magenta": "\033[95m",
}
if sys.stdout.isatty() and color in colors:
print(f"{colors[color]}{message}\033[0m")
else:
print(message)