Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
2

get error show on screen

asked 2016-02-03 12:13:40 -0500

ngkhanh's avatar

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-02-03 13:11:45 -0500

updated 2016-02-03 14:30:10 -0500

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.

edit flag offensive delete link more

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2016-02-03 12:13:40 -0500

Seen: 81 times

Last updated: Feb 03 '16