File size: 408 Bytes
ae6148e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import logging
import warnings
import os

# Ignore warnings
warnings.filterwarnings("ignore")

# Ensure log directory exists
os.makedirs("./log", exist_ok=True)

# Configure logging
logging.basicConfig(
    filename="./log/app.log",
    level=logging.INFO,
    format="%(asctime)s - %(levelname)s - %(message)s",
)

def get_logger(name):
    """Return a logger instance."""
    return logging.getLogger(name)