File size: 298 Bytes
2a948e9
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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"<pre>[{context} ERROR]\n{tb}</pre>"