python3 -m venv .venv
source ./venv/bin/activate
deactivate
pip3 install -r requirements
# add the logger module and configs module into python path
import sys
from pathlib import Path
current_directory = Path(__file__).parent
sys.path.append(str(current_directory / "configs"))
sys.path.append(str(current_directory / "logger"))
# import logger object from app_logger.py in logger module.
from logger import app_logger
if __name__ == '__main__':
# just use it.
app_logger.info("info message")
app_logger.debug("debug message")
app_logger.warning("warning message")
app_logger.error("error message")
app_logger.critical("critical message")
if you want to make your own python-logger. you can learn the configure in logger/logging_config.yaml.