Spaces:
Running
on
Zero
Running
on
Zero
File size: 328 Bytes
b1ce64c |
1 2 3 4 5 6 7 8 |
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
file_handler = logging.FileHandler("app.log")
file_handler.setLevel(logging.INFO)
formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
file_handler.setFormatter(formatter)
logger.addHandler(file_handler) |