Closed reynoldsbd closed 2 years ago
Side note: I am able to work around by calling console::user_attended_stderr()
directly
Would it make sense to recursively call
is_hidden
on the remote target instead?
That certainly sounds sensible, but we'd probably want to audit calls to is_hidden()
to make sure the expectations line up.
That certainly sounds sensible, but we'd probably want to audit calls to
is_hidden()
to make sure the expectations line up.
I submitted a fix for this. There were no calls to is_hidden()
to audit, so I think we are in the clear.
I wrote a custom
Log
implementation which writes log messages usingProgressBar::println
.As expected, all my log messages got swallowed up when stderr was redirected to a file. Per the docs for
ProgressBar::println
, this is expected because the draw target is considered hidden (not a TTY).To work around, I tried to call
ProgressBar::is_hidden
from within my logger. If the method returns true, I bypassProgressBar::println
and log directly to stderr witheprintln!
.Unfortunately, this technique does not work when using
MultiProgress
.I believe the culprit is here:
https://github.com/mitsuhiko/indicatif/blob/92ce4c3f9903dbcb30a087d213ca54d041f462d6/src/draw_target.rs#L125-L131
When
self.kind
isRemote
, we simply return false. Would it make sense to recursively callis_hidden
on the remote target instead?