-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
45 lines (37 loc) · 1.05 KB
/
config.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
ENVIRONMENT = 'sandbox'
LOG_CONFIG = None
def set_environment(env):
global ENVIRONMENT
ENVIRONMENT = env
configure_logging(ENVIRONMENT)
def get_env_parameter(property):
return property.get(ENVIRONMENT, property['sandbox'])
METRICS_ENABLED = True
def configure_logging(env):
global LOG_CONFIG
LOG_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"simple": {
"format": "%(asctime)s - %(levelname)s %(name)s:%(funcName)s - %(message)s",
"datefmt": "%Y-%m-%d %H:%M:%S"
}
},
"handlers": {
"console": {
"class": "logging.StreamHandler",
"level": "DEBUG",
"formatter": "simple",
"stream": "ext://sys.stdout"
},
},
"loggers": {
"app": {
"level": "INFO",
"handlers": ["console"],
"propagate": True
},
}
}
configure_logging(ENVIRONMENT)