Output parameters in log, save split-merge remote task error log

Former-commit-id: ee18880305
pull/1161/head
Piero Toffanin 2019-05-19 15:34:03 -04:00
rodzic 8cb65e9779
commit 830af126d9
2 zmienionych plików z 19 dodań i 1 usunięć

Wyświetl plik

@ -398,7 +398,14 @@ class Task:
except exceptions.TaskFailedError as e:
# Try to get output
try:
msg = "(%s) failed with task output: %s" % (task.uuid, "\n".join(task.output()[-10:]))
output_lines = task.output()
# Save to file
error_log_path = self.path("error.log")
with open(error_log_path, 'w') as f:
f.write('\n'.join(output_lines) + '\n')
msg = "(%s) failed with task output: %s\nFull log saved at %s" % (task.uuid, "\n".join(output_lines[-10:]), error_log_path)
done(exceptions.TaskFailedError(msg))
except:
log.ODM_WARNING("LRE: Could not retrieve task output for %s (%s)" % (self, task.uuid))

11
run.py
Wyświetl plik

@ -16,6 +16,17 @@ if __name__ == '__main__':
log.ODM_INFO('Initializing OpenDroneMap app - %s' % system.now())
# Print args
args_dict = vars(args)
log.ODM_DEBUG('==============')
for k in sorted(args_dict.keys()):
# Don't leak token
if k == 'sm_cluster' and args_dict[k] is not None:
log.ODM_DEBUG('%s: True')
else:
log.ODM_DEBUG('%s: %s' % (k, args_dict[k]))
log.ODM_DEBUG('==============')
progressbc.set_project_name(args.name)
# Add project dir if doesn't exist