-
Notifications
You must be signed in to change notification settings - Fork 329
Expand file tree
/
Copy pathmain.py
More file actions
52 lines (39 loc) · 1.1 KB
/
main.py
File metadata and controls
52 lines (39 loc) · 1.1 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
from loguru import logger
import urllib3
import sys
import asyncio
import platform
from process import start
import src
# SETTING POLICY FOR WINDOWS
# config = src.utils.get_config()
# using_playwright = 'faucet' in str(config.FLOW.TASKS) or 'dusted' in str(config.FLOW.TASKS)
# if not using_playwright:
# if platform.system() == "Windows":
# asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
async def main():
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()
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())