forked from 0xStarLabs/StarLabs-Monad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (29 loc) · 848 Bytes
/
main.py
File metadata and controls
38 lines (29 loc) · 848 Bytes
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
from loguru import logger
import urllib3
import sys
import asyncio
from process import start
import asyncio
import platform
if platform.system() == "Windows":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
async def main():
configuration()
await start()
def configuration():
urllib3.disable_warnings()
logger.remove()
logger.add(
sys.stdout,
colorize=True,
format="<light-cyan>{time:HH:mm:ss}</light-cyan> | <level>{level: <8}</level> | <fg #ffffff>{name}:{line}</fg #ffffff> - <bold>{message}</bold>",
)
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())