esdalmaijer / PyGaze

an open-source, cross-platform toolbox for minimal-effort programming of eye tracking experiments
www.pygaze.org
GNU General Public License v3.0
670 stars 211 forks source link

tobii: Fixed #123 - log message written on same line as gaze data #130

Closed grebdems closed 5 years ago

grebdems commented 5 years ago

When using a high frequency eye tracker (or just being generally unlucky), log entries would sometimes get written in the middle of a gaze data line in the tsv output file. Fixed this by writing the full gaze data sample in one go instead of breaking it up into smaller writes.

Tested with 1200Hz Pro Spectrum, and writing a log message every ms without issues. Cannot guarantee that the issue will never happen again (don't know enough about threading in python, or the GIL) but feels pretty safe still.