8shanrahan commited on
Commit
2a948e9
·
verified ·
1 Parent(s): 517eda0

Create logger.py

Browse files
Files changed (1) hide show
  1. logger.py +11 -0
logger.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import traceback
2
+
3
+ def debug_log(label, value=None):
4
+ print(f"[DEBUG] {label}")
5
+ if value is not None:
6
+ print(value)
7
+
8
+ def log_exception(context=""):
9
+ tb = traceback.format_exc()
10
+ print(f"[ERROR] Exception during {context}:\n{tb}")
11
+ return f"<pre>[{context} ERROR]\n{tb}</pre>"