<p>neels <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21513">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">do not redirect_stdout in test scripts<br><br>In a test, I called print() on a multi-line string and saw the log<br>showing each line 0.2 seconds apart. redirect.stdout seems to be pretty<br>inefficient.<br><br>Instead, put a print() function into the testenv, to directly call log()<br>on the strings passed to print().<br><br>The initial idea for redirect_stdout was that we could print() in any<br>deeper functions called from a test script. But we have no such nested<br>print() anywhere, only in test scripts themselves.<br><br>As a result of this, a multi-line print() in test scripts now no longer<br>puts the log prefix (timestamp, test name...) and suffix (backtrace /<br>source position) to each single line, but prints the multiline block<br>between a single log prefix and suffix -- exactly like the log()<br>function does everywhere else.<br><br>I actually briefly implemented adding the log prefix to each separate<br>line everywhere, but decided that it is not a good idea: in some places<br>we log config file snippets and other lists, and prepending the log<br>prefix to each line makes pasting such a snippet from (say) a jenkins<br>log super cumbersome. And the log prefix (backtrace) attached on each<br>separate line makes multiline blocks very noisy, unreadable.<br><br>Change-Id: I0972c66b9165bd7f2b0b387e0335172849199193<br>---<br>M selftest/suite_test/suite_test.ok<br>M src/osmo_gsm_tester/core/log.py<br>M src/osmo_gsm_tester/core/test.py<br>M src/osmo_gsm_tester/testenv.py<br>4 files changed, 24 insertions(+), 55 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/13/21513/2</pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21513">change 21513</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21513"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-gsm-tester </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I0972c66b9165bd7f2b0b387e0335172849199193 </div>
<div style="display:none"> Gerrit-Change-Number: 21513 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>