Private
Public Access
1
0

more verbose logging

This commit is contained in:
Sander Roosendaal
2020-06-21 10:29:54 +02:00
parent 1914b855de
commit de6fdd9378

View File

@@ -38,6 +38,25 @@ def time_in_path(df,p,maxmin='max',getall=False,name='unknown',logfile=None):
if len(df[b==2]):
if logfile is not None:
t = time.localtime()
timestamp = time.strftime('%b-%d-%Y_%H%M', t)
with open(logfile,'a') as f:
f.write('\n')
f.write(timestamp)
f.write(' ')
f.write(name)
f.write(' ')
f.write(maxmin)
f.write(' ')
f.write(str(getall))
f.write(' ')
f.write(str(len(df[b==2])))
f.write(' ')
if len(df[b==2])>1:
f.write(' passes found')
else:
f.write(' pass found')
if getall:
return df[b==2]['time'],df[b==2]['cum_dist']
else:
@@ -57,6 +76,8 @@ def time_in_path(df,p,maxmin='max',getall=False,name='unknown',logfile=None):
f.write(str(getall))
f.write(' ')
f.write(str(len(df[b==2])))
f.write(' ')
f.write(' pass not found')
raise InvalidTrajectoryError("Trajectory doesn't go through path")