-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfig.py
48 lines (43 loc) · 1.28 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
46
47
48
from pathlib import Path
# Base root directory (parent of application dir).
BASE_PATH = Path(__file__).parents[1]
# The directory path containing the root __init__.py of the package.
DATA_PATH = BASE_PATH / "data"
# Path to the directory from where to read the incoming files.
INBOX_PATH = DATA_PATH / "inbox"
# Path to the directory where to put the processed files.
PROCESSED_PATH = DATA_PATH / "processed"
# Logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'simple': {
'format': '%(levelname)s %(asctime)s %(module)s %(message)s'
},
'console': {
'format': ('[%(asctime)s][%(levelname)s] %(name)s '
'%(filename)s:%(funcName)s:%(lineno)d | %(message)s'),
'datefmt': '%H:%M:%S',
}
},
'handlers': {
'simple': {
'level': 'INFO',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
'console': {
'level': 'ERROR',
'class': 'logging.StreamHandler',
'formatter': 'console'
}
},
'loggers': {
'app': {
'handlers': ['simple', 'console'],
'level': 'DEBUG',
'propagate': False
},
}
}