-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
28 lines (23 loc) · 900 Bytes
/
main.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
import logging
import sys
from PyQt5.QtWidgets import QApplication
from simulator.settings import *
if __name__ == '__main__':
levels = {'error': logging.ERROR,
'warn': logging.WARN,
'info': logging.INFO,
'debug': logging.DEBUG}
logger = logging.getLogger('log')
logger.setLevel(levels[LOGGING_LEVEL])
ch = logging.StreamHandler()
ch.setFormatter(logging.Formatter('%(asctime)s %(levelname)s: %(message)s', datefmt='%H:%M:%S'))
logger.addHandler(ch)
if SAVE_LOG_TO_FILE:
fh = logging.FileHandler(LOG_FILE_PATH)
fh.setFormatter(logging.Formatter('%(asctime)s %(levelname)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S'))
logger.addHandler(fh)
app = QApplication(sys.argv)
from simulator.mainwindow import ui_mainwindow
ui_mainwindow.initFileUI()
ui_mainwindow.show()
exit(app.exec_())