Fixed exception when log file not available
This commit is contained in:
@@ -5,6 +5,7 @@ from .data import log
|
||||
|
||||
|
||||
def read_log(logfile: str, app: gui.Gui) -> None:
|
||||
try:
|
||||
logfile = open(logfile, 'r', encoding='utf8')
|
||||
loglines = follow(logfile)
|
||||
for line in loglines:
|
||||
@@ -13,6 +14,8 @@ def read_log(logfile: str, app: gui.Gui) -> None:
|
||||
if message and message.trade and message.to_from == 'From':
|
||||
log.debug(message.trade)
|
||||
app.add_tab(30, message)
|
||||
except IOError:
|
||||
log.error(f'Error opening log file {logfile}.')
|
||||
|
||||
|
||||
def follow(thefile: str):
|
||||
|
||||
Reference in New Issue
Block a user