-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathconfig.py
More file actions
38 lines (33 loc) Β· 1.08 KB
/
config.py
File metadata and controls
38 lines (33 loc) Β· 1.08 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
import logging
from logging.handlers import RotatingFileHandler
LOG_FILE_NAME = "bot.log"
PORT = '8080'
OWNER_ID = 1234567890
MSG_EFFECT = 5046509860389126442
# VPLink URL Shortener Configuration
VPLINK_API_TOKEN = ""
VPLINK_API_URL = "https://vplink.in/api"
# URL Shortener Providers Configuration
URL_SHORTENERS = {
'vplink': {
'name': 'VPLink',
'api_url': 'https://vplink.in/api',
'api_token': VPLINK_API_TOKEN,
'format': 'text',
'active': True
}
}
def LOGGER(name: str, client_name: str) -> logging.Logger:
logger = logging.getLogger(name)
formatter = logging.Formatter(
f"[%(asctime)s - %(levelname)s] - {client_name} - %(name)s - %(message)s",
datefmt='%d-%b-%y %H:%M:%S'
)
file_handler = RotatingFileHandler(LOG_FILE_NAME, maxBytes=50_000_000, backupCount=10)
file_handler.setFormatter(formatter)
stream_handler = logging.StreamHandler()
stream_handler.setFormatter(formatter)
logger.setLevel(logging.INFO)
logger.addHandler(file_handler)
logger.addHandler(stream_handler)
return logger