Allow temporary printing to console
See original GitHub issueIt would be nice to be able to temporarily print to console or print in place. For example, I would like to have output like
================================================
My Verbose Test Cases
================================================
Started Noisy Test Case
and then over time have it print out
Started Noisy Test Case ... Doing setup
Started Noisy Test Case ... Logging In
Started Noisy Test Case ... Entering Data
Started Noisy Test Case ... Submitted
Started Noisy Test Case ... Validating Results
Started Noisy Test Case ... Completed (and I am happy)
and then ends up like
================================================
My Verbose Test Cases
================================================
Started Noisy Test Case ... Completed (and I am happy) | PASS |
------------------------------------------------------------------------------
My Verbose Test Cases | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output: C:\sandbox\tooloud\output.xml
Log: C:\sandbox\tooloud\log.html
Report: C:\sandbox\tooloud\report.html
Each of these would be a log keyword call; something like
Log Entering Data temporary=${True}
Log Completed (and I am happy)\n in-place=${False}
or some other flag ?!?
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (13 by maintainers)
Top Results From Across the Web
How to make a temporary output - python - Stack Overflow
This simple code will work on python console, but not Ipython console nor Ipython Notebook. def hello(): print 'Hello', time.sleep(2) print ...
Read more >KB5005652—Manage new Point and Print default driver ...
Right-click Point and Print Restrictions, and then click Edit. In the Point and Print Restrictions dialog, click Enabled. Select the Users can only...
Read more >Temporarily Continuing Printing with One Ink Cartridge When ...
Make sure that On is selected for Permit temporary one cartridge printing and close the window. Load plain paper or envelopes. Access the...
Read more >Controlling permissions for temporary security credentials
Create, update, or disable permissions that are assigned to temporary AWS security credentials.
Read more >How can I force my printer to print in black when ... - Super User
or ask your own question. The Overflow Blog. Let's talk about our favorite terminal tools (Ep. 521).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I suppose Ed wants a real time messaging to console, showing only the current log entry which would be end in the final message. This is usually done sending a Carriage Return (CR) char, like ‘\r’, in the beginning of log message. The problem with this is when output is redirected to file/stream not a display.
You actually can accomplish this already, at least to some extend, by using
Log Console
with newlines (\n
) and carriage returns (\r
) in the test data. Try, for example, running this example with--ConsoleMarkers off
option:As you can see if you test the above, there’s a problem that
\r
doesn’t erase the earlier text but just moves the cursor to the beginning of the line. Thus you end up withBAR---
and not withBAR
that you might expect/want. A solution is adding enough spaces at the end of the string. That could be done manually e.g. like${SPACE * 10}
, but perhaps enhancingLog To Console
to accept the amount of padding as an optional argument would be better.Even better than making the padding optional would be accepting the same format specification that Python’s
format()
function accepts. It would allow configuring padding, alignment, etc. What do others think, should we addformat_spec=None
argument toLog To Console
and perhaps also toLog
? Should we even consider adding a separate keywords just for string formatting?