Re: changing cf CLI trace stream from stdout to stderr


Daniel Mikusa
 

Just my $0.02, but I like the current behavior. I find it helpful for
troubleshooting purposes to be able to get the stream of HTTP messages
inline with the output from the cli. It helps to very quickly and easily
establish a timeline and isolate a particular HTTP request / response as
being a problem, like when a response is slow. Just run `CF_TRACE=true cf
...` and watch to see where it pauses.

I like the suggestion in the GH issue.

Perhaps adding the option of specifying CF_TRACE=stderr (and stdout for
consistency, which would be equal to using 1) could be a way to do it.

IMHO, if you did this then the default option would matter a lot less. I'd
still prefer to keep the default behavior to STDOUT, but that's mostly me
just being selfish. As long as I have a way to invoke that stdout behavior
when I need it, I could live with the default changing.

Dan


On Tue, Oct 25, 2016 at 8:10 PM, Koper, Dies <diesk(a)fast.au.fujitsu.com>
wrote:

Hi Hector,



I have not been able to find a way to make that work on Windows.

CF_TRACE=/dev/stderr just creates a “dev” directory in the root of the
drive you run cf from with a file called “stderr”.



Regards,

Dies Koper
Cloud Foundry Product Manager - CLI





*From:* Hector Rivas Gandara [mailto:hector.rivas.gandara@
digital.cabinet-office.gov.uk]
*Sent:* Tuesday, October 25, 2016 10:27 PM
*To:* Discussions about Cloud Foundry projects and the system overall.
*Subject:* [cf-dev] Re: changing cf CLI trace stream from stdout to stderr



Hello,

Have you tried sending CF_TRACE to /dev/stderr? Like this

CF_TRACE=/dev/stderr cf apps | less

I think it is system specific, but it should work on most of them.



On 25 October 2016 at 04:44, Koper, Dies <diesk(a)fast.au.fujitsu.com>
wrote:

Hi friends,



Currently, the cf CLI trace when enabled (“CF_TRACE=true”, `cf config
–trace true` or with the `-v` option) is directed to stdout.

Looking at other commands, e.g. `curl -v`, it’s common to send such
information to stderr.

This recently came up in the following issue.

https://github.com/cloudfoundry/cli/issues/962



I’d like to know whether anyone would be massively inconvenienced if we
fixed this to make cf CLI trace output go to stderr (e.g. because you have
many scripts expecting trace to be streamed to stdout, or not expecting
anything but errors and warnings to be streamed to stderr)?

Note that trace configured to output to a file would not be affected.



Cheers,

Dies Koper
Cloud Foundry Product Manager - CLI








--

Regards

Hector Rivas | GDS / Multi-Cloud PaaS

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.