ecologist / logging_config.py
mjwong's picture
Upload 12 files
7713f64 verified
raw
history blame contribute delete
378 Bytes
import logging
# Configure logging
logging.basicConfig(
level=logging.INFO, # Set the default logging level
format="%(asctime)s - %(levelname)s - %(message)s",
handlers=[
logging.StreamHandler(), # Log to the console
logging.FileHandler("app.log", mode="a") # Log to a file
]
)
# Create a logger instance
logger = logging.getLogger(__name__)