-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
32 lines (21 loc) · 883 Bytes
/
Copy pathconfig.py
File metadata and controls
32 lines (21 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import logging
from os import getenv
ADMIN_USER = getenv('CHECKIN_ADMIN_USER', 'admin')
ADMIN_PASSWORD = getenv('CHECKIN_ADMIN_PASSWORD', object())
GOOGLE_API_KEY = getenv('CHECKIN_GOOGLE_API_KEY')
DB_HOST = getenv('CHECKIN_DB_HOST', 'localhost')
DB_PORT = int(getenv('CHECKIN_DB_PORT', 5432))
DB_USER = getenv('CHECKIN_DB_USER')
DB_PASSWORD = getenv('CHECKIN_DB_PASSWORD')
DB_NAME = getenv('CHECKIN_DB_NAME')
LOG_LEVEL = getenv('CHECKIN_LOG_LEVEL', 'INFO').upper()
def configure_logging(level=LOG_LEVEL):
logger = logging.getLogger('checkin')
logger.setLevel(level)
formatter = logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s')
stream_handler = logging.StreamHandler()
stream_handler.setLevel(LOG_LEVEL)
stream_handler.setFormatter(formatter)
logger.addHandler(stream_handler)
return logger
logger = configure_logging()