-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
74 lines (63 loc) · 1.85 KB
/
settings.py
File metadata and controls
74 lines (63 loc) · 1.85 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env python3
import logging
from logging.config import dictConfig
from os import getenv
from pathlib import Path
from dotenv import load_dotenv
load_dotenv()
BASE_DIR_PATH = Path(__file__).parent
COGS_DIR = "cmds"
COGS_DIR_PATH = BASE_DIR_PATH.joinpath(COGS_DIR)
BOT_TOKEN = getenv("TOKEN")
BOT_CHANNEL_ID = int(getenv("BOT_CHANNEL_ID"))
HTTP_TIMEOUT = 10
# LOGS
LOGS_DIR = "logs"
LOGS_DIR_PATH = BASE_DIR_PATH.joinpath(LOGS_DIR)
LOG_FILE = "info.log"
LOG_FILE_PATH = LOGS_DIR_PATH.joinpath(LOG_FILE)
LOGS_DIR_PATH.mkdir(exist_ok=True)
# F1
F1_SCHEDULE_REMINDER_DAY = int(getenv("F1_SCHEDULE_REMINDER_DAY"))# Monday
F1_SCHEDULE_REMINDER_HOUR = int(getenv("F1_SCHEDULE_REMINDER_HOUR"))
F1_SCHEDULE_REMINDER_MINUTE = int(getenv("F1_SCHEDULE_REMINDER_MINUTE"))
LOGGING_CONFIG = {
"version": 1,
"disabled_existring_loggers": False,
"formatters": {
"verbose": {"format": "%(levelname)-10s - %(ascitime)s - %(module)-15s : %(message)s"},
"standard": {"format": "%(levelname)-10s - %(name)-15s : %(message)s"}
},
"handlers": {
"console": {
"level": "DEBUG",
"class": "logging.StreamHandler",
"formatter": "standard"
},
"console2": {
"level": "WARNING",
"class": "logging.StreamHandler",
"formatter": "standard"
},
"file": {
"level": "INFO",
"class": "logging.FileHandler",
"filename": str(LOG_FILE_PATH),
"mode": "w",
"formatter": "standard"
},
},
"loggers": {
"bot": {
"handlers": ["console"],
"level": "INFO",
"propagate": False
},
"discord": {
"handlers": ["console2", "file"],
"level": "INFO",
"propagate": False
},
}
}
dictConfig(LOGGING_CONFIG)