Files
Jordan Ritter 2482317ccc style: apply ruff format to Python codebase
320 files reformatted. One-time alignment to match the ruff format
check added to CI in #4812.
2026-05-13 23:10:35 -07:00

28 lines
501 B
Python

"""
Logging setup for CopilotKit.
"""
import logging
import os
import sys
def get_logger(name: str):
"""
Get a logger with the given name.
"""
logger = logging.getLogger(name)
log_level = os.getenv("LOG_LEVEL")
if log_level:
logger.setLevel(log_level.upper())
return logger
def bold(text: str) -> str:
"""
Bold the given text.
"""
if hasattr(sys.stdout, "isatty") and sys.stdout.isatty():
return f"\033[1m{text}\033[0m"
return text