OpenModelica / OMSimulator

The OpenModelica FMI & SSP-based co-simulation environment.
Other
70 stars 50 forks source link

Logfile not closed after terminating simulation? #1184

Open Fredrik1Haider opened 2 years ago

Fredrik1Haider commented 2 years ago

Description

When appending data to the logfile generated by OMS.setLogFile, the appended text gets cutoff suggesting the file has not been closed properly after terminating the simulation, i.e. the file writing buffer is still open.

Steps to reproduce the behavior

additional_info = ["Very important to know", "Where am I?", "How did I end up here?"]

OMS.setLogFile('log.txt')
OMS.simulate...
OMS.terminate...

with open(log.txt, 'a') as logfile:
      logfile.write("\n".join(additional_info))

in resulting file parts of additional_info is missing.

Version and OS