0

I have some programs (which I do not have source access to) that update a progress bar on one line of the console, which looks fine when run from a command prompt. But when TeamCity runs these programs and captures stdout, it captures each update as a separate line, which is taking up a huuuuuuuge amount of space in logs. Is there some way to improve this behaviour? I'm running TeamCity 2018.1 (build 58245).

This is the kind of thing I'm talking about (imagine this reported tens of thousands of times):

[09:15:55][Step 2/2] MyScript: Waiting... (|)
[09:15:55][Step 2/2] MyScript: Waiting... (/)
[09:15:56][Step 2/2] MyScript: Waiting... (-)
[09:15:56][Step 2/2] MyScript: Waiting... (\)
[09:15:56][Step 2/2] MyScript: Waiting... (|)
[09:15:56][Step 2/2] MyScript: Waiting... (/)
[09:15:56][Step 2/2] MyScript: Waiting... (-)
[09:15:56][Step 2/2] MyScript: Waiting... (\)
[09:15:56][Step 2/2] MyScript: Waiting... (|)
[09:15:56][Step 2/2] MyScript: Waiting... (/)
[09:15:56][Step 2/2] MyScript: Waiting... (-)
[09:15:57][Step 2/2] MyScript: Waiting... (\)
[09:15:57][Step 2/2] MyScript: Waiting... (|)
[09:15:57][Step 2/2] MyScript: Waiting... (/)
[09:15:57][Step 2/2] MyScript: Waiting... (-)
[09:15:57][Step 2/2] MyScript: Waiting... (\)
[09:15:57][Step 2/2] MyScript: Waiting... (|)
Ben Hymers
  • 25,586
  • 16
  • 59
  • 84

1 Answers1

0

If you don't have access to source code of this program, your only option is to suppress its output like:

yourprogram.exe > nul

In case you need more options, check this out: Suppress command line output

Peska
  • 3,980
  • 3
  • 23
  • 40
  • Thanks - this will fix the problem but I'd like to still keep *something* in the log :) I was hoping for some way to get TeamCity to either update its log entries, or to detect that the line has been overwritten and ignore it? Perhaps by ignoring everything after a carriage return without a newline? – Ben Hymers Jul 10 '18 at 11:36
  • TeamCity is capturing standard output. There is no magic in here. If you still need some output, then you might try to filter it like: `yourprogram.exe | findstr /v /c:"MyScript: Waiting"`. – Peska Jul 10 '18 at 12:48