First time here? Check our help page!
2

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.

ngkhanh's avatar
2.2k
ngkhanh
asked 2016-02-03 12:13:40 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

2

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.

rpg777's avatar
7k
rpg777
answered 2016-02-03 13:11:45 -0500, updated 2016-02-03 14:30:10 -0500
edit flag offensive 0 remove flag delete link

Comments

What are statements for show the stderr info ? have any measure help for this kind ?

ngkhanh's avatar ngkhanh (2016-02-03 13:58:07 -0500) edit

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.

rpg777's avatar rpg777 (2016-02-03 14:27:23 -0500) edit

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

ngkhanh's avatar ngkhanh (2016-02-03 15:03:21 -0500) edit

FWIW, these will only be printed out when the measure terminates, successfully or otherwise. :(

__AmirRoth__'s avatar __AmirRoth__ (2016-02-03 15:22:03 -0500) edit

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.

rpg777's avatar rpg777 (2016-02-03 16:07:21 -0500) edit
add a comment see more comments