aboutsummaryrefslogtreecommitdiff
path: root/api/log.py
blob: b8b7e4ac3988863bd13cb7b4b2523034ba0f147e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import logging
from dotenv import load_dotenv
from os import environ

load_dotenv()

# logging module wrapper (same as db.py)
log_level = [None, logging.ERROR, logging.WARNING,
             logging.INFO][int(environ["CONNECT4_LOG_LEVEL"])]

logging.basicConfig(format="[ %(levelname)s ]: %(message)s", level=log_level)

# log functions
error = logging.error
info = logging.info
warning = logging.warning