Skip to content
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

tracing-subscriberが問答無用でANSI escape sequenceを出す #385

Closed
qryxip opened this issue Jan 19, 2023 · 3 comments · Fixed by #386
Closed

tracing-subscriberが問答無用でANSI escape sequenceを出す #385

qryxip opened this issue Jan 19, 2023 · 3 comments · Fixed by #386

Comments

@qryxip
Copy link
Member

qryxip commented Jan 19, 2023

不具合の内容

tracing-subscriberは出力がリダイレクトされていたとしても問答無用でANSI escape sequenceを出してしまいます。そのことを忘れてました。

現象・ログ

https://twitter.com/chagara_r/status/1616108219415564288
https://twitter.com/chagara_r/status/1616109330604118022

再現手順

期待動作

ファイルに書き出されるときはエスケープシーケンスを出さない

OSの種類/ディストリ/バージョン

多分全部

その他

解決方法としてはリダイレクトを検出するか(attyクレートは確か開発が止まっているので、代替を探す)、色を付けるのをそもそもやめるかですね。

@Hiroshiba
Copy link
Member

おお、なるほどです!!

ちょっとよくわかっていないのですが、色を付けるのをやめたら治まる感じでしょうか。
であれば、本番ビルド時は色付けをやめる形がいいのかなと思いました!

@qryxip
Copy link
Member Author

qryxip commented Jan 19, 2023

attyクレートは確か開発が止まっているので、代替を探す

is-terminalらしいのでそれにしようかと。

clap-rs/clap#4249

@qryxip qryxip changed the title tracing-subscriberが問答無用でASCI escape sequenceを出す tracing-subscriberが問答無用でANSI escape sequenceを出す Jan 19, 2023
@qryxip
Copy link
Member Author

qryxip commented Jan 19, 2023

貼るべきツイートはこっちでしたね。CP932のコマンドプロンプトは...そっかそれもありますね。
https://twitter.com/chagara_r/status/1616109330604118022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants