-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmain.py
More file actions
54 lines (42 loc) · 1.21 KB
/
main.py
File metadata and controls
54 lines (42 loc) · 1.21 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
from loguru import logger
import urllib3
import sys
import asyncio
import platform
import logging
from process import start
from src.utils.output import show_logo, show_dev_info
from src.utils.check_github_version import check_version
if platform.system() == "Windows":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
async def main():
show_logo()
show_dev_info()
configuration()
await start()
log_format = (
"<light-blue>[</light-blue><yellow>{time:HH:mm:ss}</yellow><light-blue>]</light-blue> | "
"<level>{level: <8}</level> | "
"<cyan>{file}:{line}</cyan> | "
"<level>{message}</level>"
)
def configuration():
urllib3.disable_warnings()
logger.remove()
# Disable primp and web3 logging
logging.getLogger("primp").setLevel(logging.WARNING)
logging.getLogger("web3").setLevel(logging.WARNING)
logger.add(
sys.stdout,
colorize=True,
format=log_format,
)
logger.add(
"logs/app.log",
rotation="10 MB",
retention="1 month",
format="{time:YYYY-MM-DD HH:mm:ss} | {level} | {name}:{line} - {message}",
level="INFO",
)
if __name__ == "__main__":
asyncio.run(main())