utk-robotics-2017 / rip_python

A generalized robot framework to be used with future IEEE robots
1 stars 0 forks source link

Figure out logger flushing #34

Open amessing opened 7 years ago

amessing commented 7 years ago

At competition, the logs didn't save. What caused this?

amessing commented 7 years ago

Our flushing issue there is a MemoryHandler around the FileHandler. File gets flushed at 10 MB or when the program closes.

One solution is have a competition mode that doesn't use the MemoryHandler

robobenklein commented 7 years ago

file = open(filename) file.write(line) file.flush() os.fsync(file)

amessing commented 7 years ago

The issue is

fh = logging.handlers.MemoryHandler(1024 1024 10, logging.ERROR, fh_)

if we have a comp mode

fh = fh_

then we will be good