-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Target::Pipe doesn't work #208
Comments
Thanks for looking into it, and sorry for breaking things. |
I have found the error in |
A easy solution would be to change BufferWriter::pipe to always set |
I think we should no longer unconditionally hold that
Removes color in general, or when using a |
I explicitly enabled colors, else the default for pipes would be to disable color. |
I will try the idea without the |
Something like this? |
Same problem here. |
Can report having the same problem - that would be a really awesome addition if that worked though 😄 |
Ups, it has been a few days... |
I do also think that colors disabled makes more sense for pipes (by default). We could think about adding some kind of way to enable them back again. |
It is already disabled by default for pipes, the example just enables them to show that it's possible. |
Is this problem fixed now? Both 0.8.4 and 0.9 versions have problems.. |
Seems like #211 would fix this. |
when will this patch be merged and released? @TilCreator |
No idea, but I hope soon |
Any news on this? |
#217 contains an incomplete fix for this. I'm not sure it can really be completed without breaking changes though. |
I'm quite busy right now, so I will sadly not be of much help, sry (also my non critical applications currently work fine with #211) |
env_logger should support it but it is currently broken: rust-cli/env_logger#208
just encountered this issue as well, it is confusing that this feature ( also is there any progress on #217 to be ready for merge? |
Yeah, I suppose some docs plus a |
I've read through all of the various issues and pull requests, and there seems to be a consensus that disabling color for pipe targets (at least initially) is acceptable. For example, this comment from @mainrs:
Is there any reason that @niklasha's patch is not a valid (perhaps interim) solution to this issue? If not, I'm happy to create a small PR updating the documentation to clarify that this feature is only supported in test contexts. It's definitely confusing in its current state, as the last few commenters here can attest. :-) |
That approach sounds reasonable, I'd be happy about a PR. |
My PR over at the termcolor repo will make a simple path for enabling color for pipe targets down the road. But it doesn't do us any good until it's on crates.io. |
@walkie I thinks that color output should be disabled be default, but I think it still is an important feature, for example I use the color output to combine the indicatif progress bar and pretty env logger in https://gitlab.com/TilCreator/rustycomicscraper/-/blob/master/src/main.rs |
I've published version 0.9.1 that deprecates |
I offer to fix it, if I only knew what the requirements on a solution are. I have already devised a solution that "works for me" above: #208 (comment) but I understand you have issues with it? |
I already told you that I would be happy to review a PR with your patch, but I don't think you created one? |
Eh, you did? I must have misunderstood then. I will prepare a PR. |
`env_logger` does not handle writing to file for the moment, see rust-cli/env_logger#208
`env_logger` does not handle writing to file for the moment, see rust-cli/env_logger#208
`env_logger` does not handle writing to file for the moment, see rust-cli/env_logger#208
`env_logger` does not handle writing to file for the moment, see rust-cli/env_logger#208
Use `simplelog` to handle logs, as `env_logger` does not handle writing to file for the moment, see rust-cli/env_logger#208
Use `simplelog` to handle logs, as `env_logger` does not handle writing to file for the moment, see rust-cli/env_logger#208 Do not push most verbose logs on stdout, only push them in the log file
Use `simplelog` to handle logs, as `env_logger` does not handle writing to file for the moment, see rust-cli/env_logger#208 Do not push most verbose logs on stdout, only push them in the log file
Use `simplelog` to handle logs, as `env_logger` does not handle writing to file for the moment, see rust-cli/env_logger#208 Do not push most verbose logs on stdout, only push them in the log file
Use `simplelog` to handle logs, as `env_logger` does not handle writing to file for the moment, see rust-cli/env_logger#208 Do not push most verbose logs on stdout, only push them in the log file
Use `simplelog` to handle logs, as `env_logger` does not handle writing to file for the moment, see rust-cli/env_logger#208 Do not push most verbose logs on stdout, only push them in the log file
Use `simplelog` to handle logs, as `env_logger` does not handle writing to file for the moment, see rust-cli/env_logger#208 Do not push most verbose logs on stdout, only push them in the log file
Use `simplelog` to handle logs, as `env_logger` does not handle writing to file for the moment, see rust-cli/env_logger#208 Do not push most verbose logs on stdout, only push them in the log file
It should have, yes. |
In #204, we introduce
Target::Pipe
to redirect log messages into custom writer. And it's included in 0.8.4 now.But when I try the example in that PR, it doesn't print the message
from pipe
at all, and not even callWriteAdapter::write
. Thelog::error
message just go straight to stderr.How to make it catch all log message into my custom writer object?
The text was updated successfully, but these errors were encountered: