Refactor logging

This commit is contained in:
2021-03-20 21:31:16 +01:00
parent a321824fda
commit 965eb3be48
4 changed files with 14 additions and 5 deletions

View File

@@ -1,7 +1,9 @@
from src import gui
from src import trader
from src import config
from src import data
from src import sendkeys
from src.data import compile_regex
from src.data import log
from threading import Thread
from argparse import Namespace, ArgumentParser
@@ -17,9 +19,12 @@ def setup_args() -> Namespace:
if __name__ == "__main__":
args = setup_args()
log.debug(f'Read config from "{args.configfile}"')
conf = config.read_config(args.configfile)
data.compile_regex(conf)
log.debug('Compiling regex')
compile_regex(conf)
app = gui.Gui()
my_thread = Thread(target=trader.read_log, args=(conf['General']['log_file'], app))
log.debug(f'Starting reader thread for "{conf["General"]["log_file"]}"')
my_thread.start()
app.mainloop()