get error show on screen
Hello, i would like to show stderr file content of OSM model and measure on Run screen of Open studio. As default only stdout are shown.
First time here? Check out the Help page!
Hello, i would like to show stderr file content of OSM model and measure on Run screen of Open studio. As default only stdout are shown.
If you want additional messages to be printed to the console window of the OS application's run tab, you'll need to add those statements to your own measures. Another option would be to write a report measure that locates all these log files and writes their contents to the console window. Unfortunately there is no global loglevel-type option in the app.
There is an example of snagging stdout
in an OpenStudio measure here; using capture3
instead of capture2
in that example will give you the stderr
as well.
You'd need to capture the stderr channel and write it all out later. The OpenStudio Server tool does this at a pretty low level. Ruby has its own tools for this, which you could use in your own measures; there are some use examples here. I updated my answer here with an OS Measure example for how to get stdout/stderr too.
Sorry, but my ruby skill is limited, i understand that it requires open3
module to take this code :
ver = Open3.capture3("#{path}/rcontrib -version")
print_statement("Radiance version info: #{ver[0]}", runner)
What are statement "#{path}/rcontrib -version"
? as far as my understanding array ver
will get all statemenst from file then printout by print_statement
but how method capture3 record the stderr content ? by row or by what ? The stderr often has unpredictable paragraphs
FWIW, these will only be printed out when the measure terminates, successfully or otherwise. :(
The example above uses a utility function in the Radiance measure, which sends the stdout to runner.registerInfo for the server and to a 'puts' for OSApp, so it actually does print immediately.
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2016-02-03 12:13:40 -0600
Seen: 100 times
Last updated: Feb 03 '16