-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.py
63 lines (58 loc) · 1.45 KB
/
settings.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import os
import sys
import logging
from logging.config import dictConfig
from dotenv import load_dotenv
import random
from random import choice, shuffle
import io
import aiohttp
import re
import string
from string import ascii_lowercase, digits
load_dotenv()
DISCORD_API_SECRET = os.getenv("DISCORD_API_TOKEN")
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":{
"console":{
'level': "DEBUG",
'class': "logging.StreamHandler",
'formatter': "standard"
},
"console2":{
'level': "WARNING",
'class': "logging.StreamHandler",
'formatter': "standard"
},
"file":{
'level': "INFO",
'class': "logging.FileHandler",
'filename': "logs/info.log",
'mode': "w",
'formatter': "verbose"
},
},
"loggers":{
"bot": {
'handlers': ['console'],
"level": "INFO",
"propagate": False
},
"discord": {
'handlers': ['console2', "file"],
"level": "INFO",
"propagate": False
}
}
}
dictConfig(LOGGING_CONFIG)