mirror of
https://github.com/LmeSzinc/AzurLaneAutoScript.git
synced 2025-01-08 12:27:33 +08:00
Fix: Error log extraction
This commit is contained in:
parent
433391bf3b
commit
68d6a54f44
7
alas.py
7
alas.py
@ -20,6 +20,7 @@ class AzurLaneAutoScript:
|
||||
stop_event: threading.Event = None
|
||||
|
||||
def __init__(self, config_name='alas'):
|
||||
logger.hr('Start', level=0)
|
||||
self.config_name = config_name
|
||||
ConfigUpdater().update_config(config_name)
|
||||
|
||||
@ -43,6 +44,9 @@ class AzurLaneAutoScript:
|
||||
from module.device.device import Device
|
||||
device = Device(config=self.config)
|
||||
return device
|
||||
except RequestHumanTakeover:
|
||||
logger.critical('Request human takeover')
|
||||
exit(1)
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
exit(1)
|
||||
@ -103,7 +107,8 @@ class AzurLaneAutoScript:
|
||||
lines = f.readlines()
|
||||
start = 0
|
||||
for index, line in enumerate(lines):
|
||||
if re.search('\+-{15,}\+', line):
|
||||
line = line.strip(' \r\t\n')
|
||||
if re.match('^═{15,}$', line):
|
||||
start = index
|
||||
lines = lines[start - 2:]
|
||||
lines = handle_sensitive_logs(lines)
|
||||
|
Loading…
Reference in New Issue
Block a user