Hi all!
I have been running RRA through the OpenSim Python API on the OpenScienceGrid. When I run the code not through Python not on the OpenScienceGrid, the opensim.log file is autocreated with all of the RRA mass adjustments etc. being outputted in that file. However, for whatever reason the opensim.log file is not being created automatically when running the Python code through the OpenScienceGrid. I am trying to manually create that file using the Logger class. I am now getting a file, but it still does not include the RRA outputs needed. Is there a different way to create this file manually that I am missing?
Thanks!
Molly
Logger Output
- Mohammadreza Rezaie
- Posts: 418
- Joined: Fri Nov 24, 2017 12:48 am
Re: Logger Output
Hi, I'm not familiar with OpenScienceGrid and it's not clear from your description how you are implementing Logger. OpenSim automatically creates opensim.log file, but you can still create it manually (be sure to call removeFileSink() first):
Also, you can run any setup file using opensim-cmd.exe and save its log file:
Hope this helps,
Mohammadreza
Code: Select all
osim.Logger.setLevelString('Info')
osim.Logger.removeFileSink()
osim.Logger.addFileSink('log_file.log')
Code: Select all
from subprocess import call
with open('log_file.log', 'w') as f:
call(['opensim-cmd', 'run-tool', 'setup_file.xml')], stdout=f)
Mohammadreza
- Molly Shepherd
- Posts: 17
- Joined: Thu Nov 14, 2019 9:36 am
Re: Logger Output
That is exactly what I needed, thank you!!