I have a log file I track on my own. I am running a python script on raspberry pi and printing messages at various parts/events of the code. I have the script outputs piped to a text file. Some cycles all messages are logged and other cycles hardly anything is logged. The exact same events happen each cycle so I should see the same messages logged. What would cause this to happen? Is this a python issue or linux issue? The script does not crash but the logging is inconsistent.
example command running in my /etc/rc.local folder:
sudo python test.py >> log.txt&