-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
49 lines (42 loc) · 1.22 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
49
import logging
import os
logger = logging.getLogger(__name__)
# Secrets & Config
DISCORD_API_SECRET = os.environ.get("DISCORD_API_SECRET", None)
BOT_STATUS = ["Example Status 1", "Example Status 2", "Example Status 3"]
# Define attached cogs here, add by folder name e.g. ./example/cog.py -> "example"
COGS = [
"example",
]
# Database
DATABASE = "/data/my-db.db"
# Logging
LOG_PATH = "/data/log.log"
if not os.path.exists(LOG_PATH):
os.makedirs(os.path.dirname(LOG_PATH), exist_ok=True)
with open(LOG_PATH, "w", encoding="utf-8"):
pass
LOGGING_CONFIG = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"standard": {"format": "%(asctime)s [%(levelname)s] %(name)s: %(message)s"},
},
"handlers": {
"stream": {
"level": "INFO",
"formatter": "standard",
"class": "logging.StreamHandler",
"stream": "ext://sys.stdout",
},
"file": {
"level": "INFO",
"formatter": "standard",
"class": "logging.FileHandler",
"filename": f"{LOG_PATH}",
},
},
"loggers": {
"": {"handlers": ["stream", "file"], "level": "INFO", "propagate": False},
},
}