mdasad3617 commited on
Commit
2c9aac4
·
verified ·
1 Parent(s): ae7d660

Create logging_utils.py

Browse files
Files changed (1) hide show
  1. logging_utils.py +13 -0
logging_utils.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Utilities for logging.
2
+
3
+ import logging
4
+
5
+ def setup_logging(log_file='logs/app.log'):
6
+ logging.basicConfig(
7
+ level=logging.INFO,
8
+ format='%(asctime)s - %(levelname)s - %(message)s',
9
+ handlers=[
10
+ logging.FileHandler(log_file),
11
+ logging.StreamHandler()
12
+ ]
13
+ )