first commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
import logging
|
||||
|
||||
# Create logs folder if it doesn't exist
|
||||
Path("logs").mkdir(exist_ok=True)
|
||||
|
||||
# Daily log file
|
||||
log_file = Path("logs") / f"etl_{datetime.now():%Y%m%d}.log"
|
||||
|
||||
# Configure logging
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s | %(levelname)-8s | %(message)s",
|
||||
datefmt="%Y-%m-%d %H:%M:%S",
|
||||
handlers=[
|
||||
logging.StreamHandler(),
|
||||
logging.FileHandler(log_file, encoding="utf-8"),
|
||||
],
|
||||
)
|
||||
|
||||
# Export logger
|
||||
log = logging.getLogger("etl")
|
||||
Reference in New Issue
Block a user