import traceback def debug_log(label, value=None): print(f"[DEBUG] {label}") if value is not None: print(value) def log_exception(context=""): tb = traceback.format_exc() print(f"[ERROR] Exception during {context}:\n{tb}") return f"
[{context} ERROR]\n{tb}"