-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
76 lines (67 loc) · 1.92 KB
/
settings.py
File metadata and controls
76 lines (67 loc) · 1.92 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
75
76
import os
import pathlib
from logging.config import dictConfig
import logging
from dotenv import load_dotenv
load_dotenv()
DISCORD_API_SECRET = os.getenv("DISCORD_API_TOKEN")
OWNER_ID = 350393195085168650
BASE_DIR = pathlib.Path(__file__).parent
COGS_DIR = BASE_DIR / "cogs"
CHANGELOG_PATH = BASE_DIR / "changelog.txt"
LOGGING_CONFIG = {
"version": 1,
"disabled_existing_loggers": False,
"formatters": {
"verbose": {
"format": "%(levelname)-10s - %(asctime)s - %(module)-15s : %(message)s"
},
"standard": {"format": "%(levelname)-10s - %(name)-15s : %(message)s"},
},
"handlers": {
"consoleDebug": {
"level": "DEBUG",
"class": "logging.StreamHandler",
"formatter": "standard",
},
"consoleDebugVerbose": {
"level": "DEBUG",
"class": "logging.StreamHandler",
"formatter": "verbose",
},
"consoleWarning": {
"level": "WARNING",
"class": "logging.StreamHandler",
"formatter": "standard",
},
"discordFile": {
"level": "INFO",
"class": "logging.FileHandler",
"filename": "logs/discord.log",
"mode": "w",
"formatter": "verbose",
},
"botFile": {
"level": "INFO",
"class": "logging.FileHandler",
"filename": "logs/bot.log",
"mode": "w",
"formatter": "verbose",
},
},
"loggers": {
"bot": {
"handlers": ["consoleDebug", "botFile"],
"level": "INFO",
"propagate": False
},
"discord": {
"handlers": ["consoleWarning", "discordFile"],
"level": "INFO",
"propagate": False,
},
},
}
dictConfig(LOGGING_CONFIG)
###
# WHEN WE RETURN: WE WERE WORKING MAKING A NEW HANDLER THAT USES THE VERBOSE FORMATTER